summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-11-14 17:48:56 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-11-14 17:48:56 +0100
commit27ee9ee8e816334447f1cf781bc2892469e0c8dc (patch)
treee31a6269e1d26325f96fa4eccbf00d96eb6c950c
parentb6ce0cd83afaab1bc03f7421745ff752c3459e99 (diff)
Don't AlignToPixel in SwView::SetVisArea
When e.g. inserting a Writer doc in a Calc doc ("Insert - Object - OLE Object... - Create new - LibreOffice 5.3 Text" in Calc), the resulting .ods contains the size of the embedded Writer doc in two places. First as <draw:frame svg:width=... svg:height=... ...> in content.xml, where the size is apparently the original rectangle's size, before it got aligned in SetVisArea. And a second time as <config:config-item config:name="ViewAreaWidth" config:type="long">...</config:config-item> <config:config-item config:name="ViewAreaHeight" config:type="long">...</config:config-item> in Object 1/settings.xml, where the size is apparently the aligned size. When the document is loaded again, at first the first size is used to display the inner Writer doc. But when the inner Writer doc is double-clicked (to make it editable), now the second size is used, and because they don't match, the whole document is erroneously considered modified (ScTabViewShell::ActivateObject -> SfxInPlaceClient::SetObjArea -> SfxInPlaceClient::Invalidate -> ScClient::ViewChanged -> ScDocShell::SetDrawModified -> ScDocShell::SetModified -> SfxObjectShell::SetModified), causing e.g. the "Save" icon to become "active". It is unclear to me whether these calls to AlignToPixel still serve any real purpose; lets see whether removing them causes any issues... Change-Id: I755dd9e8b2406f0b4b41d0f3d1281d6ad4b1b238
-rw-r--r--sw/source/uibase/uiview/viewport.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index 0c70ff66c855..f34b89cd842a 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -217,16 +217,13 @@ void SwView::SetVisArea( const Rectangle &rRect, bool bUpdateScrollbar )
// If m_pWrtShell's visible area is the whole document, do the same here.
aOldSz = m_pWrtShell->VisArea().SSize();
- const Point aTopLeft( AlignToPixel( rRect.TopLeft() ));
- const Point aBottomRight( AlignToPixel( rRect.BottomRight() ));
- Rectangle aLR( aTopLeft, aBottomRight );
-
- if( aLR == m_aVisArea )
+ if( rRect == m_aVisArea )
return;
const SwTwips lMin = IsDocumentBorder() ? DOCUMENTBORDER : 0;
// No negative position, no negative size
+ Rectangle aLR = rRect;
if( aLR.Top() < lMin )
{
aLR.Bottom() += lMin - aLR.Top();