[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 2 commits - sw/qa vcl/source writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Jun 24 00:33:06 PDT 2015
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 4 ++--
vcl/source/window/paint.cxx | 12 ++++++++++++
writerfilter/source/dmapper/GraphicImport.cxx | 8 ++++----
3 files changed, 18 insertions(+), 6 deletions(-)
New commits:
commit 115662b46ee3cea3620b016c9a2ac91ac9eaaeec
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Jun 24 09:08:56 2015 +0200
tdf#89698 DOCX import: inline picture should have no spacing
Commit 3d7e168a2a43c2414b0633379102ddb29437e75b (n#783638 DOCX import of
wp:inline's distT/B/L/R attributes, 2012-10-11) was about a picture that
had non-zero spacing in LO, but zero in Word. The hope was that the
problem is just that the value is not imported.
Then commit a88ac708403c03d0f950f09ec29c0d5a1e5a85b4 (fdo#63685
wp:inline's distT/B/L/R is in EMU's, not twips, 2013-04-19) was about a
picture that had so large spacing that the picture become invisible.
Fixing the unit of the spacing value made the picture visible again.
What was missed is that this value is just stored in the doc model, but
layout in Word doesn't use it at all till the anchoring is as-char.
Given that in LO as-char anchoring supports real spacing, just don't
import these values to have the same layout. That's what the WW8 import
does, too.
Change-Id: I1244269e06c5d190e8340349ddc12ae7b0572a4d
(cherry picked from commit 9781a8786da5c32e2250cbe1ae97bd10f84f39bb)
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 5995027..d8cd372 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1380,8 +1380,8 @@ DECLARE_OOXMLIMPORT_TEST(testConditionalstylesTablelook, "conditionalstyles-tbll
DECLARE_OOXMLIMPORT_TEST(testFdo63685, "fdo63685.docx")
{
- // Was 85697, i.e. original 114120 was converted to mm100 from twips, not from EMUs.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(318), getProperty<sal_Int32>(getShape(1), "TopMargin"));
+ // An inline image's wrapping should be always zero, even if the doc model has a non-zero value.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getShape(1), "TopMargin"));
}
DECLARE_OOXMLIMPORT_TEST(testN592908_Frame, "n592908-frame.docx")
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 0111889..154b9e2 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -870,16 +870,16 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
}
break;
case NS_ooxml::LN_CT_Inline_distT:
- m_pImpl->nTopMargin = oox::drawingml::convertEmuToHmm(nIntValue);
+ m_pImpl->nTopMargin = 0;
break;
case NS_ooxml::LN_CT_Inline_distB:
- m_pImpl->nBottomMargin = oox::drawingml::convertEmuToHmm(nIntValue);
+ m_pImpl->nBottomMargin = 0;
break;
case NS_ooxml::LN_CT_Inline_distL:
- m_pImpl->nLeftMargin = oox::drawingml::convertEmuToHmm(nIntValue);
+ m_pImpl->nLeftMargin = 0;
break;
case NS_ooxml::LN_CT_Inline_distR:
- m_pImpl->nRightMargin = oox::drawingml::convertEmuToHmm(nIntValue);
+ m_pImpl->nRightMargin = 0;
break;
case NS_ooxml::LN_CT_GraphicalObjectData_uri:
rValue.getString();
commit 6ce2e29078265c41e83f9094244e638eba82e836
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Jun 23 16:30:21 2015 +0200
vcl: fix window vs buffer map mode mismatch in PaintHelper
This avoids painting the first few menu items in really large scale on
the whole window after window resize.
Change-Id: I2469403684b1ae3b93892d49536115df2cef81bc
Reviewed-on: https://gerrit.libreoffice.org/16429
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
(cherry picked from commit b9064c0780232610af9e4d45ba5c85b9496d1f75)
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 4b6e8f5..7b00628 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -48,6 +48,7 @@ private:
vcl::Region* m_pChildRegion;
Rectangle m_aSelectionRect;
Rectangle m_aPaintRect;
+ MapMode m_aPaintRectMapMode;
vcl::Region m_aPaintRegion;
sal_uInt16 m_nPaintFlags;
bool m_bPop : 1;
@@ -117,6 +118,9 @@ void PaintHelper::CreateBuffer()
SetupBuffer();
+ // Remember what was the map mode of m_aPaintRect.
+ m_aPaintRectMapMode = m_pWindow->GetMapMode();
+
// update the output size now, after all the settings were copied
m_pBuffer->SetOutputSize(m_pWindow->GetOutputSize());
@@ -171,7 +175,15 @@ void PaintHelper::PaintBuffer()
// [ie. everything you can see was painted directly to the
// window either above or in eg. an event handler]
if (!getenv("VCL_DOUBLEBUFFERING_AVOID_PAINT"))
+ {
+ // The map mode of m_pWindow and/or m_pBuffer may have changed since
+ // CreateBuffer(), set it back to what it was, otherwise unwanted
+ // scaling or translating may happen.
+ m_pWindow->SetMapMode(m_aPaintRectMapMode);
+ m_pBuffer->SetMapMode(m_aPaintRectMapMode);
+
m_pWindow->DrawOutDev(m_aPaintRect.TopLeft(), m_aPaintRect.GetSize(), m_aPaintRect.TopLeft(), m_aPaintRect.GetSize(), *m_pBuffer.get());
+ }
}
void PaintHelper::DoPaint(const vcl::Region* pRegion)
More information about the Libreoffice-commits
mailing list