[Libreoffice-commits] core.git: sw/qa sw/source writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Feb 17 17:16:40 CET 2014
sw/qa/extras/ooxmlexport/data/dml-groupshape-relsize.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 9 +++++++++
sw/source/core/layout/anchoreddrawobject.cxx | 5 +++--
writerfilter/source/dmapper/GraphicImport.cxx | 3 +--
4 files changed, 13 insertions(+), 4 deletions(-)
New commits:
commit f7a7a5a686367aa775fef8d077bfdfec7b2fad82
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Feb 17 16:27:39 2014 +0100
SwAnchoredDrawObject::GetObjBoundRect: ignore relative size of group shapes
Instead of not reading the relative size of group shapes at all, read it
into the document model, just ignore it during painting. Visually this
doesn't change anything, however this way we can write the information
back to the file.
Change-Id: Ic24fceaacec0f831d657a35e52493e1c0e9bf626
diff --git a/sw/qa/extras/ooxmlexport/data/dml-groupshape-relsize.docx b/sw/qa/extras/ooxmlexport/data/dml-groupshape-relsize.docx
new file mode 100755
index 0000000..6be137b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/dml-groupshape-relsize.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 86b1d84..9514031 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2308,6 +2308,15 @@ DECLARE_OOXMLEXPORT_TEST(testDmlShapeRelsize, "dml-shape-relsize.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", "page");
}
+DECLARE_OOXMLEXPORT_TEST(testDmlGroupshapeRelsize, "dml-groupshape-relsize.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+ // Relative size wasn't imported.
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", "page");
+}
+
DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index dd260ec..65416d4 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -27,8 +27,8 @@
// --> #i32795#
#include <txtfrm.hxx>
// --> #i32795#
-// template class <std::vector>
#include <vector>
+#include <svx/svdogrp.hxx>
using namespace ::com::sun::star;
@@ -626,8 +626,9 @@ const SwRect SwAnchoredDrawObject::GetObjRect() const
// --> #i70122#
const SwRect SwAnchoredDrawObject::GetObjBoundRect() const
{
+ bool bGroupShape = PTR_CAST(SdrObjGroup, GetDrawObj());
// Resize objects with relative width or height
- if ( GetPageFrm( ) && ( GetDrawObj( )->GetRelativeWidth( ) || GetDrawObj()->GetRelativeHeight( ) ) )
+ if ( !bGroupShape && GetPageFrm( ) && ( GetDrawObj( )->GetRelativeWidth( ) || GetDrawObj()->GetRelativeHeight( ) ) )
{
Rectangle aPageRect = GetPageFrm( )->GetBoundRect( ).SVRect();
Rectangle aCurrObjRect = GetDrawObj()->GetCurrentBoundRect();
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index f3d33cf..2009bf5 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -955,8 +955,7 @@ void GraphicImport::lcl_sprm(Sprm & rSprm)
sal_Int16 nPositivePercentage = rtl::math::round(m_pImpl->m_rPositivePercentages.front().toDouble() / oox::drawingml::PER_PERCENT);
m_pImpl->m_rPositivePercentages.pop();
- uno::Reference<lang::XServiceInfo> xServiceInfo(m_xShape, uno::UNO_QUERY);
- if (nPositivePercentage && !xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
+ if (nPositivePercentage)
{
uno::Reference<beans::XPropertySet> xPropertySet(m_xShape, uno::UNO_QUERY);
OUString aProperty = nSprmId == NS_ooxml::LN_CT_SizeRelH_pctWidth ? OUString("RelativeWidth") : OUString("RelativeHeight");
More information about the Libreoffice-commits
mailing list