// Author: Julian Smart
// Modified by:
// Created: 2005-09-30
-// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
return wildcard;
}
+#if wxUSE_FFILE && wxUSE_STREAMS
/// Load a file
bool wxRichTextBuffer::LoadFile(const wxString& filename, wxRichTextFileType type)
{
else
return false;
}
+#endif // wxUSE_FFILE && wxUSE_STREAMS
+#if wxUSE_STREAMS
/// Load from a stream
bool wxRichTextBuffer::LoadFile(wxInputStream& stream, wxRichTextFileType type)
{
else
return false;
}
+#endif // wxUSE_STREAMS
/// Copy the range to the clipboard
bool wxRichTextBuffer::CopyToClipboard(const wxRichTextRange& range)
const int colCount = table->GetColumnCount();
wxArrayInt rowTops;
rowTops.Add(0, rowCount+1);
- for (int row = 0; row < rowCount; ++row)
+ int row;
+ for (row = 0; row < rowCount; ++row)
{
for (int column = 0; column < colCount; ++column)
{
bool needsRelay = false;
- int row, col;
for (row = 0; row < rowCount-1; ++row) // -1 as the bottom row can't rowspan
{
- for (col = 0; col < colCount; ++col)
+ for (int col = 0; col < colCount; ++col)
{
wxRichTextCell* cell = table->GetCell(row, col);
if (cell && cell->IsShown())
// There were overflowing rowspanning cells, so layout yet again to make the increased row depths show
for (row = 0; row < rowCount; ++row)
{
- for (col = 0; col < colCount; ++col)
+ for (int col = 0; col < colCount; ++col)
{
wxRichTextCell* cell = table->GetCell(row, col);
if (cell && cell->IsShown())
wxRichTextAttr attr(GetAttributes());
context.ApplyVirtualAttributes(attr, this);
+ bool tableHasPercentWidth = (attr.GetTextBoxAttr().GetWidth().GetUnits() == wxTEXT_ATTR_UNITS_PERCENTAGE);
// If we have no fixed table size, and assuming we're not pushed for
// space, then we don't have to try to stretch the table to fit the contents.
- bool stretchToFitTableWidth = false;
-
+ bool stretchToFitTableWidth = tableHasPercentWidth;
+
int tableWidth = rect.width;
- if (attr.GetTextBoxAttr().GetWidth().IsValid())
+ if (attr.GetTextBoxAttr().GetWidth().IsValid() && !tableHasPercentWidth)
{
tableWidth = converter.GetPixels(attr.GetTextBoxAttr().GetWidth());