summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-09-15 17:18:15 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2010-09-15 17:18:15 +0200
commitd8c68b41b4ffd318744d5fc2ca0e60bdc37aca4e (patch)
tree6a6b705aeb18db8aeff8dc28f4dc0d2e50fbaf4d
parent0701397a485c6cce318fbf8751bf8894dca314c4 (diff)
sc-fit-to-width-height-skip-breaks.diff: Increase Excel compatibility
n#404232, n#404563, i#94698 ignore manual breaks when the "fit to x pages wide and x pages tall" option is used, for Excel interoperability.
-rw-r--r--sc/source/core/data/table5.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index 7c13756aab38..fc4f55e7d681 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -135,6 +135,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
bool bSkipColBreaks = false;
bool bSkipRowBreaks = false;
+ bool bSkipBreaks = false;
if ( pStyleSet->GetItemState( ATTR_PAGE_SCALETOPAGES, FALSE, &pItem ) == SFX_ITEM_SET )
{
@@ -152,6 +153,15 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
bSkipRowBreaks = true;
}
+ if (!bSkipBreaks && pStyleSet->GetItemState(ATTR_PAGE_SCALETO, false, &pItem) == SFX_ITEM_SET)
+ {
+ const ScPageScaleToItem& rScaleToItem = static_cast<const ScPageScaleToItem&>(
+ pStyleSet->Get(ATTR_PAGE_SCALETO));
+ if (rScaleToItem.GetWidth() > 0 || rScaleToItem.GetHeight() > 0)
+ // when fitting to a fixed width x height, ignore manual breaks.
+ bSkipBreaks = true;
+ }
+
//--------------------------------------------------------------------------
long nPageSizeX = aPageSizeTwips.Width();