[Libreoffice-commits] core.git: filter/source sw/qa

2023-03-03 Thread Michael Stahl (via logerrit)
 filter/source/config/fragments/filters/OOXML_Text.xcu  |2 +-
 filter/source/config/fragments/filters/OOXML_Text_Template.xcu |2 +-
 filter/source/config/fragments/types/writer_OOXML.xcu  |2 +-
 filter/source/config/fragments/types/writer_OOXML_Template.xcu |2 +-
 sw/qa/uitest/writer_tests3/save_readonly_with_password.py  |2 +-
 sw/qa/uitest/writer_tests7/tdf131936.py|2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 7391942099d4a76639c1aa8e559643b2702da2b7
Author: Michael Stahl 
AuthorDate: Fri Mar 3 11:20:14 2023 +0100
Commit: Michael Stahl 
CommitDate: Fri Mar 3 16:49:30 2023 +

tdf#137883 filter: use en-dash instead of hyphen in UINames

(regression from commit ed0476b0625c4361df5ff040a6661a9634588cea)

Change-Id: I7c380a9871cf16623031751bd735f456a7ea200f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148167
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/config/fragments/filters/OOXML_Text.xcu 
b/filter/source/config/fragments/filters/OOXML_Text.xcu
index be5089123828..bbcceb1713d8 100644
--- a/filter/source/config/fragments/filters/OOXML_Text.xcu
+++ b/filter/source/config/fragments/filters/OOXML_Text.xcu
@@ -21,7 +21,7 @@
 com.sun.star.comp.Writer.WriterFilter
 
 
-Word 2010-365 Document
+Word 2010–365 Document
 
 
 1
diff --git a/filter/source/config/fragments/filters/OOXML_Text_Template.xcu 
b/filter/source/config/fragments/filters/OOXML_Text_Template.xcu
index abd511768ea6..55d326563bf6 100644
--- a/filter/source/config/fragments/filters/OOXML_Text_Template.xcu
+++ b/filter/source/config/fragments/filters/OOXML_Text_Template.xcu
@@ -21,7 +21,7 @@
 com.sun.star.comp.Writer.WriterFilter
 
 
-Word 2010-365 Template
+Word 2010–365 Template
 
 
 1
diff --git a/filter/source/config/fragments/types/writer_OOXML.xcu 
b/filter/source/config/fragments/types/writer_OOXML.xcu
index f3c99f7cbda6..079a6421f072 100644
--- a/filter/source/config/fragments/types/writer_OOXML.xcu
+++ b/filter/source/config/fragments/types/writer_OOXML.xcu
@@ -23,7 +23,7 @@
 true
 Office Open XML 
Text
 
-Word 2010-365 Document
+Word 2010–365 Document
 
 MSWordDoc
 
diff --git a/filter/source/config/fragments/types/writer_OOXML_Template.xcu 
b/filter/source/config/fragments/types/writer_OOXML_Template.xcu
index 3c1fa82c6fe6..a9d424b967b4 100644
--- a/filter/source/config/fragments/types/writer_OOXML_Template.xcu
+++ b/filter/source/config/fragments/types/writer_OOXML_Template.xcu
@@ -23,7 +23,7 @@
 true
 Office Open XML Text 
Template
 
-Word 2010-365 Template
+Word 2010–365 Template
 
 MSWordDoc
 
diff --git a/sw/qa/uitest/writer_tests3/save_readonly_with_password.py 
b/sw/qa/uitest/writer_tests3/save_readonly_with_password.py
index 0591ad9e0c91..e9a6140103f4 100644
--- a/sw/qa/uitest/writer_tests3/save_readonly_with_password.py
+++ b/sw/qa/uitest/writer_tests3/save_readonly_with_password.py
@@ -30,7 +30,7 @@ class save_readonly_with_password(UITestCase):
 xFileName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
 xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": 
xFilePath}))
 xFileTypeCombo = xSaveDialog.getChild("file_type")
-select_by_text(xFileTypeCombo, "Word 2010-365 Document 
(.docx)")
+select_by_text(xFileTypeCombo, "Word 2010–365 Document 
(.docx)")
 xPasswordCheckButton = xSaveDialog.getChild("password")
 xPasswordCheckButton.executeAction("CLICK", tuple())
 xOpen = xSaveDialog.getChild("open")
diff --git a/sw/qa/uitest/writer_tests7/tdf131936.py 
b/sw/qa/uitest/writer_tests7/tdf131936.py
index c7bf9e13cd83..2d929c07d993 100644
--- a/sw/qa/uitest/writer_tests7/tdf131936.py
+++ b/sw/qa/uitest/writer_tests7/tdf131936.py
@@ -18,7 +18,7 @@ class tdf131936(UITestCase):
 with self.ui_test.execute_dialog_through_command(".uno:SaveAs", 
close_button="cancel") as xDialog:
 xFileTypeCombo = xDialog.getChild("file_type")
 state = get_state_as_dict(xFileTypeCombo)
-self.assertEqual(state["SelectEntryText"], "Word 2010-365 
Document (.docx)")
+self.assertEqual(state["SelectEntryText"], "Word 2010–365 
Document (.docx)")
 
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


[Libreoffice-commits] core.git: filter/source sw/qa

2021-03-02 Thread Svante Schubert (via logerrit)
 filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl |7 
+++
 sw/qa/extras/htmlexport/xhtmlexport.cxx |2 
+-
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 26271331c8da8c872f29463d9c390b1b570eb020
Author: Svante Schubert 
AuthorDate: Mon Aug 24 17:22:41 2020 +0200
Commit: Michael Stahl 
CommitDate: Tue Mar 2 13:22:27 2021 +0100

HTML XSLT: Overtaking masking ' for ODF font-family with spaces in names

Change-Id: I718fc232a3903d0b449a4c9a4ef4dff601744756
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111615
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git 
a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl 
b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
index d4418725f2fc..c81cc9a1e0be 100644
--- a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
@@ -214,12 +214,11 @@
 
 
 
-font-family:"
+font-family:
 
-'
 
-
-"; 
+
+; 
 
 
 
diff --git a/sw/qa/extras/htmlexport/xhtmlexport.cxx 
b/sw/qa/extras/htmlexport/xhtmlexport.cxx
index 218bb4772eb4..f60d8b912fad 100644
--- a/sw/qa/extras/htmlexport/xhtmlexport.cxx
+++ b/sw/qa/extras/htmlexport/xhtmlexport.cxx
@@ -49,7 +49,7 @@ DECLARE_HTMLEXPORT_TEST(testTdf131812, "tdf131812.odt")
 sal_uInt64 nLength = pStream->TellEnd();
 OString aStream(read_uInt8s_ToOString(*pStream, nLength));
 CPPUNIT_ASSERT(
-aStream.indexOf(".P1 { font-size:12pt; font-family:\"Liberation 
Serif\"; "
+aStream.indexOf(".P1 { font-size:12pt; font-family:\'Liberation 
Serif\'; "
 "writing-mode:horizontal-tb; direction:rtl; 
text-align:right ! important;}")
 != -1);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source sw/qa

2021-03-02 Thread Svante Schubert (via logerrit)
 filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl |   14 
+++---
 sw/qa/extras/htmlexport/xhtmlexport.cxx |2 
-
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 63b4f0c693cf181e63772170c0c2c6179ec1b621
Author: Svante Schubert 
AuthorDate: Mon Aug 24 11:47:07 2020 +0200
Commit: Michael Stahl 
CommitDate: Tue Mar 2 13:20:44 2021 +0100

HTML XSLT: Placing font-family names within 'double quotation marks' in 
case of spaces within the font name

Change-Id: I780845df636c6a07bd621fa01cb60134d3ead592
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111610
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git 
a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl 
b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
index ec5b680df150..d4418725f2fc 100644
--- a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
@@ -79,13 +79,21 @@
 
 
 
-
+
 
 :
 
 ; 
 
 
+
+
+
+:"
+
+"; 
+
+
 
 
 
@@ -206,12 +214,12 @@
 
 
 
-font-family:
+font-family:"
 
 '
 
 
-; 
+"; 
 
 
 
diff --git a/sw/qa/extras/htmlexport/xhtmlexport.cxx 
b/sw/qa/extras/htmlexport/xhtmlexport.cxx
index 85adfa2b7b49..218bb4772eb4 100644
--- a/sw/qa/extras/htmlexport/xhtmlexport.cxx
+++ b/sw/qa/extras/htmlexport/xhtmlexport.cxx
@@ -49,7 +49,7 @@ DECLARE_HTMLEXPORT_TEST(testTdf131812, "tdf131812.odt")
 sal_uInt64 nLength = pStream->TellEnd();
 OString aStream(read_uInt8s_ToOString(*pStream, nLength));
 CPPUNIT_ASSERT(
-aStream.indexOf(".P1 { font-size:12pt; font-family:Liberation Serif; "
+aStream.indexOf(".P1 { font-size:12pt; font-family:\"Liberation 
Serif\"; "
 "writing-mode:horizontal-tb; direction:rtl; 
text-align:right ! important;}")
 != -1);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source sw/qa

2020-12-02 Thread Xisco Fauli (via logerrit)
 filter/source/msfilter/eschesdo.cxx   |   37 +++---
 sw/qa/extras/ww8export/data/tdf128501.doc |binary
 sw/qa/extras/ww8export/ww8export3.cxx |   17 +
 3 files changed, 46 insertions(+), 8 deletions(-)

New commits:
commit 2f9325b270fab10f6900aec30ca27135363c4c69
Author: Xisco Fauli 
AuthorDate: Tue Dec 1 19:17:24 2020 +0100
Commit: Xisco Fauli 
CommitDate: Wed Dec 2 17:25:35 2020 +0100

tdf#128501: DOC export: fix lost bitmap fill for OOXML custom shapes

this fix is based on 7032be2e9edd82dad2d67f1582aaa57676bda4a1
which fixes the same problem for PPT filter

Change-Id: Id62c29892dd3fce42d27e2e46a7933154cb973f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107003
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/filter/source/msfilter/eschesdo.cxx 
b/filter/source/msfilter/eschesdo.cxx
index 7132b8067e98..24f47d62909f 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -263,15 +264,35 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( 
ImplEESdrObject& rObj,
 }
 else
 {
-addShape(sal::static_int_cast< sal_uInt16 >(eShapeType),
- nMirrorFlags | ShapeFlag::HaveShapeProperty | 
ShapeFlag::HaveAnchor);
-aPropOpt.CreateCustomShapeProperties( eShapeType, 
rObj.GetShapeRef() );
-aPropOpt.CreateFillProperties( rObj.mXPropSet, true );
-if ( rObj.ImplGetText() )
+const Reference< XPropertySet > xPropSet = rObj.mXPropSet;
+drawing::FillStyle eFS = drawing::FillStyle_NONE;
+if(xPropSet.is())
+{
+uno::Reference< XPropertySetInfo > xPropInfo = 
xPropSet->getPropertySetInfo();
+if ( xPropInfo.is() && 
xPropInfo->hasPropertyByName("FillStyle"))
+xPropSet->getPropertyValue("FillStyle") >>= eFS;
+}
+
+if (eFS == drawing::FillStyle_BITMAP && eShapeType == 
mso_sptMax)
+{
+// We can't map this custom shape to a DOC preset and it 
has a bitmap fill.
+// Make sure that at least the bitmap fill is not lost.
+addShape( ESCHER_ShpInst_PictureFrame, 
ShapeFlag::HaveShapeProperty | ShapeFlag::HaveAnchor );
+if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, 
"Bitmap", false, true, true, bOOxmlExport ) )
+aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 
0x800080 );
+}
+else
 {
-if ( !aPropOpt.IsFontWork() )
-aPropOpt.CreateTextProperties( rObj.mXPropSet, 
mpEscherEx->QueryTextID(
-rObj.GetShapeRef(), rObj.GetShapeId() ), true, 
false );
+addShape(sal::static_int_cast< sal_uInt16 >(eShapeType),
+ nMirrorFlags | ShapeFlag::HaveShapeProperty | 
ShapeFlag::HaveAnchor);
+aPropOpt.CreateCustomShapeProperties( eShapeType, 
rObj.GetShapeRef() );
+aPropOpt.CreateFillProperties( rObj.mXPropSet, true );
+if ( rObj.ImplGetText() )
+{
+if ( !aPropOpt.IsFontWork() )
+aPropOpt.CreateTextProperties( rObj.mXPropSet, 
mpEscherEx->QueryTextID(
+rObj.GetShapeRef(), rObj.GetShapeId() ), true, 
false );
+}
 }
 }
 }
diff --git a/sw/qa/extras/ww8export/data/tdf128501.doc 
b/sw/qa/extras/ww8export/data/tdf128501.doc
new file mode 100644
index ..3313e397a961
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf128501.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx 
b/sw/qa/extras/ww8export/ww8export3.cxx
index 14991fa89484..5bb4d752cd41 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -106,6 +106,23 @@ DECLARE_WW8EXPORT_TEST(testArabicZeroNumbering, 
"arabic-zero-numbering.doc")
  aMap["NumberingType"].get());
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf128501, "tdf128501.doc")
+{
+if (!mbExported)
+{
+uno::Reference xShapeDescriptor = 
getShape(1);
+CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"), 
xShapeDescriptor->getShapeType());
+}
+else
+{
+uno::Reference xShapeDescriptor = 
getShape(1);
+// Without the fix in place, this test would have failed with
+// - Expected: FrameShape
+// - Actual  : com.sun.star.drawing.CustomShape
+CPPUNIT_ASSERT_EQUAL(OUString("FrameShape"), 
xShapeDescriptor->getShapeType());
+}
+}
+
 

[Libreoffice-commits] core.git: filter/source sw/qa

2020-10-16 Thread Miklos Vajna (via logerrit)
 filter/source/msfilter/rtfutil.cxx   |   41 -
 sw/qa/extras/htmlexport/data/paint-ole.ole   |  199 +++
 sw/qa/extras/htmlexport/data/paint-ole.png   |binary
 sw/qa/extras/htmlexport/data/paint-ole.xhtml |9 +
 sw/qa/extras/htmlexport/htmlexport.cxx   |   37 +
 5 files changed, 278 insertions(+), 8 deletions(-)

New commits:
commit 247b247dadc8f0133a8eb94f1423a29315cf998a
Author: Miklos Vajna 
AuthorDate: Fri Oct 16 16:24:06 2020 +0200
Commit: Miklos Vajna 
CommitDate: Fri Oct 16 19:47:45 2020 +0200

sw reqif-xhtml import, embedded objects: handle non-package Ole10Native 
stream

Commit 800085d4fb0831f2065e86bfd99164cd89998fcd (sw reqif-xhtml import,
embedded objects: handle Ole10Native stream, 2020-05-04) added support
for handling an OLE1 stream which contained something else than OLE2
data.

However, that assumed a fixed class name ("Package") and a matching
class id. Improve this, so that the class id is created dynamically,
based on the OLE1 class name.

The class id can be figured out by putting the OLE1 data in an RTF file
and converting that RTF file to DOC using Word.

Change-Id: I1623a42a8f9b1278fd69641f1ae1ee467a6f0143
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104439
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/filter/source/msfilter/rtfutil.cxx 
b/filter/source/msfilter/rtfutil.cxx
index 9e78acf1dc00..4d6c5dda2fea 100644
--- a/filter/source/msfilter/rtfutil.cxx
+++ b/filter/source/msfilter/rtfutil.cxx
@@ -18,12 +18,31 @@
 
 namespace
 {
-/// If rOle1 is native OLE1 data of size nOle1Size, wraps it in an OLE2 
container.
-void WrapOle1InOle2(SvStream& rOle1, sal_uInt32 nOle1Size, SvStream& rOle2)
+/**
+ * If rOle1 is native OLE1 data of size nOle1Size, wraps it in an OLE2 
container.
+ *
+ * The OLE2 root's CLSID is set based on rClassName.
+ */
+void WrapOle1InOle2(SvStream& rOle1, sal_uInt32 nOle1Size, SvStream& rOle2,
+const OString& rClassName)
 {
 tools::SvRef pStorage = new SotStorage(rOle2);
-// OLE Package Object
-SvGlobalName aName(0x0003000C, 0, 0, 0xc0, 0, 0, 0, 0, 0, 0, 0x46);
+OString aAnsiUserType;
+SvGlobalName aName;
+if (rClassName == "PBrush")
+{
+aAnsiUserType = "Bitmap Image";
+aName = SvGlobalName(0x0003000A, 0, 0, 0xc0, 0, 0, 0, 0, 0, 0, 0x46);
+}
+else
+{
+if (!rClassName.isEmpty() && rClassName != "Package")
+{
+SAL_WARN("filter.ms", "WrapOle1InOle2: unexpected class name: '" 
<< rClassName << "'");
+}
+aAnsiUserType = "OLE Package";
+aName = SvGlobalName(0x0003000C, 0, 0, 0xc0, 0, 0, 0, 0, 0, 0, 0x46);
+}
 pStorage->SetClass(aName, SotClipboardFormatId::NONE, "");
 
 // [MS-OLEDS] 2.3.7 CompObjHeader
@@ -40,14 +59,13 @@ void WrapOle1InOle2(SvStream& rOle1, sal_uInt32 nOle1Size, 
SvStream& rOle2)
 pCompObj->WriteUInt32(0x4600);
 // Rest of CompObjStream
 // AnsiUserType
-OString aAnsiUserType("OLE Package");
 pCompObj->WriteUInt32(aAnsiUserType.getLength() + 1);
 pCompObj->WriteOString(aAnsiUserType);
 pCompObj->WriteChar(0);
 // AnsiClipboardFormat
 pCompObj->WriteUInt32(0x);
 // Reserved1
-OString aReserved1("Package");
+OString aReserved1(rClassName);
 pCompObj->WriteUInt32(aReserved1.getLength() + 1);
 pCompObj->WriteOString(aReserved1);
 pCompObj->WriteChar(0);
@@ -330,7 +348,14 @@ bool ExtractOLE2FromObjdata(const OString& rObjdata, 
SvStream& rOle2)
 aStream.ReadUInt32(nData); // OLEVersion
 aStream.ReadUInt32(nData); // FormatID
 aStream.ReadUInt32(nData); // ClassName
-aStream.SeekRel(nData);
+OString aClassName;
+if (nData)
+{
+// -1 because it is null-terminated.
+aClassName = read_uInt8s_ToOString(aStream, nData - 1);
+// Skip null-termination.
+aStream.SeekRel(1);
+}
 aStream.ReadUInt32(nData); // TopicName
 aStream.SeekRel(nData);
 aStream.ReadUInt32(nData); // ItemName
@@ -354,7 +379,7 @@ bool ExtractOLE2FromObjdata(const OString& rObjdata, 
SvStream& rOle2)
 else
 {
 SvMemoryStream aStorage;
-WrapOle1InOle2(aStream, nData, aStorage);
+WrapOle1InOle2(aStream, nData, aStorage, aClassName);
 rOle2.WriteStream(aStorage);
 }
 rOle2.Seek(0);
diff --git a/sw/qa/extras/htmlexport/data/paint-ole.ole 
b/sw/qa/extras/htmlexport/data/paint-ole.ole
new file mode 100644
index ..e8e78490ed68
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/paint-ole.ole
@@ -0,0 +1,199 @@
+{\object\objemb{\*\objclass PBrush}\objw13852\objh7822{\*\objdata 
+01050200070050427275736844

[Libreoffice-commits] core.git: filter/source sw/qa

2020-08-07 Thread Michael Stahl (via logerrit)
 filter/source/msfilter/escherex.cxx|   20 
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx |2 ++
 2 files changed, 22 insertions(+)

New commits:
commit 2cb90a5c87fe46737c8d840967d8836284f92ffd
Author: Michael Stahl 
AuthorDate: Fri Aug 7 15:26:48 2020 +0200
Commit: Michael Stahl 
CommitDate: Fri Aug 7 18:25:31 2020 +0200

filter: MSO export: convert TextWrap property to Escher_Wrap*

There's a paucity of working wrapping modes in Escher unfortunately.

Change-Id: Ibaf99c3249a6492dc129f9c9b5707778038f9a4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100331
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index d851e9f6723d..2dabfa2014d5 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -691,6 +692,10 @@ void EscherPropertyContainer::CreateTextProperties(
 bool bWordWrap  ( false );
 bool bAutoGrowSize  ( false );
 
+uno::Any aTextWrap;
+
+EscherPropertyValueHelper::GetPropertyValue(aTextWrap, rXPropSet, 
"TextWrap", true);
+
 if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, 
"TextWritingMode", true ) )
 aAny >>= eWM;
 if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, 
"TextVerticalAdjust", true ) )
@@ -829,6 +834,21 @@ void EscherPropertyContainer::CreateTextProperties(
 nTextAttr |= 0x20002;
 }
 }
+
+if (aTextWrap.hasValue())
+{   // explicit text wrap overrides whatever was inferred previously
+switch (aTextWrap.get())
+{
+case text::WrapTextMode_THROUGH:
+eWrapMode = ESCHER_WrapNone;
+break;
+// in theory there are 3 more Escher_Wrap, but [MS-ODRAW] says 
they are useless
+default:
+eWrapMode = ESCHER_WrapSquare;
+break;
+}
+}
+
 AddOpt( ESCHER_Prop_dxTextLeft, nLeft * 360 );
 AddOpt( ESCHER_Prop_dxTextRight, nRight * 360 );
 AddOpt( ESCHER_Prop_dyTextTop, nTop * 360 );
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 4e0bcad21fc7..9643439d1f69 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -279,6 +279,8 @@ DECLARE_OOXMLEXPORT_TEST(testAtPageShapeRelOrientation, 
"rotated_shape.fodt")
 
 // now test text rotation -> VML writing direction
 assertXPath(pXmlDocument, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/v:textbox",
 "style", "mso-layout-flow-alt:bottom-to-top");
+// text wrap -> VML
+assertXPath(pXmlDocument, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/w10:wrap",
 "type", "none");
 
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source sw/qa

2020-04-20 Thread Szabolcs (via logerrit)
 filter/source/msfilter/escherex.cxx  |5 +
 sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx|   12 
 3 files changed, 17 insertions(+)

New commits:
commit 68531e459e7a922319e6bfe8b7a5282ba0320182
Author: Szabolcs 
AuthorDate: Mon Mar 30 17:12:05 2020 +0200
Commit: László Németh 
CommitDate: Mon Apr 20 11:12:59 2020 +0200

tdf#123346 DOCX VML shape export: fix arrow marker

In some cases at import there are extra space separated
numbers at the end of the names of arrow objects.
Remove these extra numbers before they could interfere
with the choice of markers.

See commit 2d3b7a07c02c90d2d64a630ab84886ef3096edfc
(tdf#100491 fix DOCX import shape line with arrow marker).

Co_Author: Balázs Regényi

Change-Id: I2156502b0ce5cd755a731359398a40edabb603a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91375
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index 2abe567fdbeb..443d533ecadb 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -887,6 +887,11 @@ bool EscherPropertyContainer::GetLineArrow( const bool 
bLineStart,
 OUStringaArrowStartName = 
*o3tl::doAccess(aAny);
 sal_uInt16  nWhich = bLineStart ? 
sal_uInt16(XATTR_LINESTART) : sal_uInt16(XATTR_LINEEND);
 
+// remove extra space separated number
+sal_Int32 nPos = aArrowStartName.lastIndexOf(' ');
+if (nPos > -1 && aArrowStartName.lastIndexOf(' ', nPos) > -1)
+aArrowStartName = aArrowStartName.copy(0, nPos);
+
 OUString aApiName = SvxUnogetApiNameForItem(nWhich, 
aArrowStartName);
 bool bIsMapped = true;
 if ( !aApiName.isEmpty() )
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx 
b/sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx
new file mode 100644
index ..770bab263d7b
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index fbd0552b479d..447bbb1236e8 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -1123,6 +1123,18 @@ DECLARE_OOXMLEXPORT_TEST(testArrowPosition, 
"tdf104565_ArrowPosition.docx")
 "/wp:positionV/wp:posOffset", "516255");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testArrowMarker, "tdf123346_ArrowMarker.docx")
+{
+// tdf#123346: Check arrow marker.
+
+xmlDocPtr pXmlDocument = parseExport("word/document.xml");
+if (!pXmlDocument)
+return;
+
+assertXPath(pXmlDocument, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
+"/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:tailEnd", "type", 
"arrow");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source sw/qa

2020-02-10 Thread Patrick Jaap (via logerrit)
 filter/source/msfilter/dffpropset.cxx |   11 +++
 sw/qa/extras/ww8import/data/tdf130262.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx  |5 +
 3 files changed, 16 insertions(+)

New commits:
commit 8cbd7f59bb99282c4bcb60639da1263c8eb3a5e3
Author: Patrick Jaap 
AuthorDate: Thu Feb 6 18:33:19 2020 +0100
Commit: Miklos Vajna 
CommitDate: Mon Feb 10 09:35:13 2020 +0100

tdf#130262 ignore negative wrap distance values in doc prop import

Change-Id: I2c06b12c958dfde09adcc2ae4c59532ffde6b6fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88127
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/filter/source/msfilter/dffpropset.cxx 
b/filter/source/msfilter/dffpropset.cxx
index 5b0b1194ae06..e5803046b4e4 100644
--- a/filter/source/msfilter/dffpropset.cxx
+++ b/filter/source/msfilter/dffpropset.cxx
@@ -1217,6 +1217,17 @@ void DffPropSet::ReadPropSet( SvStream& rIn, bool 
bSetUninitializedOnly )
 }
 if ( bSetProperty )
 {
+// tdf#130262: ignore negative values for distances (maybe 
this list needs to be extended)
+// LO does not allow negative values but [MS-ODRAW] does not 
forbid them
+if (nRecType == DFF_Prop_dxWrapDistLeft || nRecType == 
DFF_Prop_dxWrapDistRight
+ || nRecType == DFF_Prop_dyWrapDistTop  || nRecType == 
DFF_Prop_dyWrapDistBottom )
+{
+if ( static_cast(nContent) < 0 )
+{
+break;
+}
+}
+
 mpPropSetEntries[ nRecType ].nContent = nContent;
 mpPropSetEntries[ nRecType ].aFlags = aPropFlag;
 }
diff --git a/sw/qa/extras/ww8import/data/tdf130262.doc 
b/sw/qa/extras/ww8import/data/tdf130262.doc
new file mode 100644
index ..fb60beacd79d
Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf130262.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index c67f2c9385b0..468cacfd0967 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -365,6 +365,11 @@ DECLARE_WW8IMPORT_TEST(testTdf110987, "tdf110987")
 CPPUNIT_ASSERT(sFilterName != "MS Word 97 Vorlage");
 }
 
+DECLARE_WW8IMPORT_TEST(testTdf130262, "tdf130262.doc")
+{
+// We had an infinite layout loop
+}
+
 // tests should only be added to ww8IMPORT *if* they fail round-tripping in 
ww8EXPORT
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source sw/qa

2019-05-28 Thread Miklos Vajna (via logerrit)
 filter/source/msfilter/msdffimp.cxx   |5 +
 sw/qa/extras/ww8import/data/tdf125281.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx  |   17 +
 3 files changed, 22 insertions(+)

New commits:
commit 69b62cfcbd364d7f62142149c2f690104b217ca1
Author: Miklos Vajna 
AuthorDate: Mon May 27 21:24:42 2019 +0200
Commit: Miklos Vajna 
CommitDate: Tue May 28 09:10:15 2019 +0200

tdf#125281 DOC import: fix size of lazy-loaded metafiles

Metafiles may have an external header, so once graphic data is read, we
need to set the size explicitly. Otherwise the width of the EMF image in
the bugdoc will be too small.

Change-Id: I2441eda61278b0f4973db5d9aa14618ccd17c397
Reviewed-on: https://gerrit.libreoffice.org/73064
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 8dbddea29cf1..1c31a10f7ec8 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -6610,6 +6610,11 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& 
rBLIPStream, Graphic& rData, tool
 // size to the size of this record.
 sal_uInt64 maxSize = pGrStream ==  ? nLength : 0;
 Graphic aGraphic = rGF.ImportUnloadedGraphic(*pGrStream, maxSize);
+
+// Size available in metafile header, set that here.
+if (aMtfSize100.getWidth() && aMtfSize100.getHeight())
+aGraphic.SetPrefSize(aMtfSize100);
+
 if (!aGraphic.IsNone())
 {
 rData = aGraphic;
diff --git a/sw/qa/extras/ww8import/data/tdf125281.doc 
b/sw/qa/extras/ww8import/data/tdf125281.doc
new file mode 100644
index ..15146f9e3daf
Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf125281.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index abdc2a335227..1af645f90cb1 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -204,6 +205,22 @@ DECLARE_WW8IMPORT_TEST(testTdf121734, "tdf121734.doc")
 }
 }
 
+DECLARE_WW8IMPORT_TEST(testTdf125281, "tdf125281.doc")
+{
+// Load a .doc file which has an embedded .emf image.
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+SwNode* pNode = pDoc->GetNodes()[6];
+CPPUNIT_ASSERT(pNode->IsGrfNode());
+SwGrfNode* pGrfNode = pNode->GetGrfNode();
+const Graphic& rGraphic = pGrfNode->GetGrf();
+
+// Without the accompanying fix in place, this test would have failed, as 
pref size was 0 till
+// an actual Paint() was performed (and even then, it was wrong).
+long nExpected = 25664;
+CPPUNIT_ASSERT_EQUAL(nExpected, rGraphic.GetPrefSize().getWidth());
+}
+
 DECLARE_WW8IMPORT_TEST(testTdf122425_1, "tdf122425_1.doc")
 {
 // This is for header text in case we use a hack for fixed-height headers
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: filter/source sw/qa

2019-02-06 Thread Libreoffice Gerrit user
 filter/source/config/fragments/filters/MS_Word_2007_XML_Template.xcu |2 +-
 filter/source/config/fragments/filters/OOXML_Text_Template.xcu   |2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 1ae50279d800f16d38a6bf88c63c6fd14fbd6717
Author: Vasily Melenchuk 
AuthorDate: Wed Feb 6 09:13:39 2019 +0300
Commit: Katarina Behrens 
CommitDate: Wed Feb 6 14:30:44 2019 +0100

tdf#123194: sw: change used filter for .dotx export

Now it is "Word 2007-2019 Template" and not "Office Open XML
Text Template". Export implementation is focused more on
MS variant, rather than OOXML.

This is follow-up fix for 0932e4bb9a4e4a25be092dcf87a0119d1894ac30

Change-Id: I30b99bf73c20a3be27c62ca5d871f54b1032efc1
Reviewed-on: https://gerrit.libreoffice.org/67438
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 

diff --git 
a/filter/source/config/fragments/filters/MS_Word_2007_XML_Template.xcu 
b/filter/source/config/fragments/filters/MS_Word_2007_XML_Template.xcu
index 2a116be19d98..c98a724d0c5a 100644
--- a/filter/source/config/fragments/filters/MS_Word_2007_XML_Template.xcu
+++ b/filter/source/config/fragments/filters/MS_Word_2007_XML_Template.xcu
@@ -16,7 +16,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->
 
-IMPORT ALIEN 3RDPARTYFILTER TEMPLATE 
TEMPLATEPATH
+IMPORT EXPORT ALIEN 3RDPARTYFILTER 
TEMPLATE TEMPLATEPATH
 
 com.sun.star.comp.Writer.WriterFilter
 OXML
diff --git a/filter/source/config/fragments/filters/OOXML_Text_Template.xcu 
b/filter/source/config/fragments/filters/OOXML_Text_Template.xcu
index 90fd38bf6b2a..b27998c8d6af 100644
--- a/filter/source/config/fragments/filters/OOXML_Text_Template.xcu
+++ b/filter/source/config/fragments/filters/OOXML_Text_Template.xcu
@@ -16,7 +16,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->
 
-IMPORT EXPORT ALIEN 3RDPARTYFILTER 
TEMPLATE TEMPLATEPATH
+IMPORT ALIEN 3RDPARTYFILTER TEMPLATE 
TEMPLATEPATH
 
 com.sun.star.comp.Writer.WriterFilter
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx
index bb1c813a733f..b25e588c5406 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport_template.cxx
@@ -14,7 +14,7 @@ class Test : public SwModelTestBase
 {
 public:
 Test()
-: SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML 
Text Template")
+: SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "MS Word 2007 XML 
Template")
 {
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source sw/qa sw/source

2018-11-20 Thread Libreoffice Gerrit user
 filter/source/msfilter/rtfutil.cxx|3 
 sw/qa/extras/htmlexport/htmlexport.cxx|   12 +--
 sw/source/filter/html/htmlreqifreader.cxx |   93 --
 3 files changed, 93 insertions(+), 15 deletions(-)

New commits:
commit 1ca409292272632f443733450313de5a82c54a9c
Author: Miklos Vajna 
AuthorDate: Tue Nov 20 17:31:02 2018 +0100
Commit: Miklos Vajna 
CommitDate: Tue Nov 20 20:30:07 2018 +0100

sw reqif-xhtml export: write graphic of OLE object at OLE1 level

[MS-OLEDS] 2.2.5 EmbeddedObject actually has a last Presentation field,
and we didn't write it so far.

Luckily all the info can be extracted from the OLE2 container, so we can
roundtrip the OLE1 wrapper around OLE2 nicely.

Change-Id: I8d4922428dd5beeaae8b6cd4da0575db7014e4a2
Reviewed-on: https://gerrit.libreoffice.org/63667
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/filter/source/msfilter/rtfutil.cxx 
b/filter/source/msfilter/rtfutil.cxx
index 13a8ef59b956..0d2f590c10fa 100644
--- a/filter/source/msfilter/rtfutil.cxx
+++ b/filter/source/msfilter/rtfutil.cxx
@@ -279,7 +279,8 @@ bool ExtractOLE2FromObjdata(const OString& rObjdata, 
SvStream& rOle2)
 
 if (nData)
 {
-rOle2.WriteStream(aStream);
+// NativeData
+rOle2.WriteStream(aStream, nData);
 rOle2.Seek(0);
 }
 }
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 5ae05a172078..c2d8143b67b9 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -555,14 +555,10 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOle2, 
"reqif-ole2.xhtml")
 // filter to handle it, so nothing happened on double-click.
 CPPUNIT_ASSERT(xEmbeddedObject.is());
 uno::Reference xStream(xEmbeddedObject->getStream(), 
uno::UNO_QUERY);
-// This was 80913, the RTF hexdump -> OLE1 binary -> OLE2 conversion was
-// missing.
-// Also, this was 38912 when we re-generated the OLE2 preview, which is
-// wrong, the OLE2 data is 38375 bytes in the ole2.ole (referenced by
-// reqif-ole2.xhtml). To see that this is the correct value, convert the
-// hexdump in ole2.ole to binary, remove the ole1 header and check the byte
-// size.
-CPPUNIT_ASSERT_EQUAL(static_cast(38375), xStream->getLength());
+// This was 38375, msfilter::rtfutil::ExtractOLE2FromObjdata() wrote
+// everything after the OLE1 header into the OLE2 stream, while the
+// Presentation field after the OLE2 data doesn't belong there.
+CPPUNIT_ASSERT_EQUAL(static_cast(37888), xStream->getLength());
 // Finally the export also failed as it tried to open the stream from the
 // document storage, but the embedded object already opened it, so an
 // exception of type com.sun.star.io.IOException was thrown.
diff --git a/sw/source/filter/html/htmlreqifreader.cxx 
b/sw/source/filter/html/htmlreqifreader.cxx
index fc2c11705b80..a119fc2fbc9c 100644
--- a/sw/source/filter/html/htmlreqifreader.cxx
+++ b/sw/source/filter/html/htmlreqifreader.cxx
@@ -92,8 +92,59 @@ OString ExtractOLEClassName(const tools::SvRef& 
xStorage)
 return read_uInt8s_ToOString(*pCompObj, nData);
 }
 
+/// Parses the presentation stream of an OLE2 storage.
+bool ParseOLE2Presentation(SvStream& rOle2, sal_uInt32& nWidth, sal_uInt32& 
nHeight,
+   SvStream& rPresentationData)
+{
+// See [MS-OLEDS] 2.3.4, OLEPresentationStream
+rOle2.Seek(0);
+tools::SvRef pStorage = new SotStorage(rOle2);
+tools::SvRef xOle2Presentation
+= pStorage->OpenSotStream("\002OlePres000", StreamMode::STD_READ);
+
+// Read AnsiClipboardFormat.
+sal_uInt32 nMarkerOrLength = 0;
+xOle2Presentation->ReadUInt32(nMarkerOrLength);
+if (nMarkerOrLength != 0x)
+// FormatOrAnsiString is not present
+return false;
+sal_uInt32 nFormatOrAnsiLength = 0;
+xOle2Presentation->ReadUInt32(nFormatOrAnsiLength);
+if (nFormatOrAnsiLength != 0x0003) // CF_METAFILEPICT
+return false;
+
+// Read TargetDeviceSize.
+sal_uInt32 nTargetDeviceSize = 0;
+xOle2Presentation->ReadUInt32(nTargetDeviceSize);
+if (nTargetDeviceSize != 0x0004)
+// TargetDevice is present
+return false;
+
+sal_uInt32 nAspect = 0;
+xOle2Presentation->ReadUInt32(nAspect);
+sal_uInt32 nLindex = 0;
+xOle2Presentation->ReadUInt32(nLindex);
+sal_uInt32 nAdvf = 0;
+xOle2Presentation->ReadUInt32(nAdvf);
+sal_uInt32 nReserved1 = 0;
+xOle2Presentation->ReadUInt32(nReserved1);
+xOle2Presentation->ReadUInt32(nWidth);
+xOle2Presentation->ReadUInt32(nHeight);
+sal_uInt32 nSize = 0;
+xOle2Presentation->ReadUInt32(nSize);
+
+// Read Data.
+if (nSize > xOle2Presentation->remainingSize())
+return false;
+std::vector aBuffer(nSize);
+

[Libreoffice-commits] core.git: filter/source sw/qa sw/source

2017-11-05 Thread Szymon Kłos
 filter/source/msfilter/msdffimp.cxx   |8 
 sw/qa/extras/ww8export/ww8export2.cxx |6 +-
 sw/source/core/edit/edfcol.cxx|   20 +++-
 3 files changed, 24 insertions(+), 10 deletions(-)

New commits:
commit 1e6abe31eb8f7c12c725f7e1267a7cedfcd3d157
Author: Szymon Kłos 
Date:   Thu Nov 2 17:22:03 2017 +0100

tdf#113037 create Watermark with correct ratio

Change-Id: I17ab8d98a618cff6e38dad344f4096dc520cce43
Reviewed-on: https://gerrit.libreoffice.org/44228
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index fdc3f1e3a5dd..1fc80da83cb8 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4419,13 +4419,13 @@ SdrObject* SvxMSDffManager::ImportShape( const 
DffRecordHeader& rHd, SvStream& r
 OutputDevice* pOut = Application::GetDefaultDevice();
 vcl::Font aFont( pOut->GetFont() );
 aFont.SetFamilyName( aFontName );
-auto nTextWidth = pOut->GetTextWidth( aObjectText );
+tools::Rectangle aBoundingRect;
+pOut->GetTextBoundRect( aBoundingRect, aObjectText );
 
 OUString aObjName = GetPropertyString(DFF_Prop_wzName, 
rSt);
-if ( nTextWidth && aObjData.eShapeType == 
mso_sptTextPlainText && aObjName.match("PowerPlusWaterMarkObject"))
+if ( aBoundingRect.GetWidth() && aObjData.eShapeType 
== mso_sptTextPlainText && aObjName.match( "PowerPlusWaterMarkObject" ) )
 {
-fRatio = aFont.GetFontSize().Height();
-fRatio /= nTextWidth;
+fRatio = (double)aBoundingRect.GetHeight() / 
aBoundingRect.GetWidth();
 sal_Int32 nNewHeight = fRatio * 
aObjData.aBoundRect.getWidth();
 sal_Int32 nPaddingY = 
aObjData.aBoundRect.getHeight() - nNewHeight;
 
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx 
b/sw/qa/extras/ww8export/ww8export2.cxx
index 94039067e58d..1c180173f11b 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 
 class Test : public SwModelTestBase
 {
@@ -269,7 +270,10 @@ DECLARE_WW8EXPORT_TEST(testTdf91687, "tdf91687.doc")
 uno::Reference xWatermark = getShape(1);
 uno::Reference xWatermarkProperties(xWatermark, 
uno::UNO_QUERY);
 
-CPPUNIT_ASSERT_EQUAL((sal_Int32)5172, xWatermark->getSize().Height);
+sal_Int32 nHeight = 0;
+xWatermarkProperties->getPropertyValue(UNO_NAME_TEXT_UPPERDIST) >>= 
nHeight;
+
+CPPUNIT_ASSERT_EQUAL((sal_Int32)5172, xWatermark->getSize().Height + 
nHeight);
 CPPUNIT_ASSERT_EQUAL((sal_Int32)18105, xWatermark->getSize().Width);
 }
 
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 0e2fc36051bc..2b32ccfb9f0d 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -1307,14 +1307,22 @@ void lcl_placeWatermarkInHeader(const SfxWatermarkItem& 
rWatermark,
 
 // Calc the ratio.
 double fRatio = 0;
+double fRatioFrame = 0;
 OutputDevice* pOut = Application::GetDefaultDevice();
 vcl::Font aFont(pOut->GetFont());
 aFont.SetFamilyName(sFont);
-auto nTextWidth = pOut->GetTextWidth(rWatermark.GetText());
-if (nTextWidth)
+
+tools::Rectangle aBoundingRect;
+pOut->GetTextBoundRect(aBoundingRect, rWatermark.GetText());
+if (aBoundingRect.GetWidth())
 {
-fRatio = aFont.GetFontSize().Height();
-fRatio /= nTextWidth;
+fRatio = (double)aBoundingRect.GetHeight() / 
aBoundingRect.GetWidth();
+auto nTextWidth = pOut->GetTextWidth(rWatermark.GetText());
+if (nTextWidth)
+{
+fRatioFrame = aFont.GetFontSize().Height();
+fRatioFrame /= nTextWidth;
+}
 }
 
 // Calc the size.
@@ -1339,7 +1347,8 @@ void lcl_placeWatermarkInHeader(const SfxWatermarkItem& 
rWatermark,
 xPageStyle->getPropertyValue(UNO_NAME_BOTTOM_MARGIN) >>= 
nBottomMargin;
 nWidth = aSize.Height - nTopMargin - nBottomMargin;
 }
-sal_Int32 nHeight = nWidth * fRatio;
+sal_Int32 nHeight = fRatio * nWidth;
+sal_Int32 nFrameHeight = fRatioFrame * nWidth;
 
 // Create and insert the shape.
 uno::Reference 
xShape(xMultiServiceFactory->createInstance(aShapeServiceName), uno::UNO_QUERY);
@@ -1379,6 +1388,7 @@ void lcl_placeWatermarkInHeader(const SfxWatermarkItem& 
rWatermark,
 xPropertySet->setPropertyValue(UNO_NAME_VERT_ORIENT_RELATION, 

[Libreoffice-commits] core.git: filter/source sw/qa

2017-10-26 Thread Andrea Gelmini
 filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl |2 +-
 sw/qa/extras/uiwriter/uiwriter.cxx|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 21fe5ef04dbea6b620e45453b8567f32ebd8526f
Author: Andrea Gelmini 
Date:   Thu Oct 26 16:46:37 2017 +0200

Fix typos

Change-Id: I96f64b7c259f04a67684bb699ea3cc43b68e40fa
Reviewed-on: https://gerrit.libreoffice.org/43913
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl 
b/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
index 6a1b01078eeb..dc378058ca8f 100644
--- a/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
+++ b/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
@@ -4327,7 +4327,7 @@
 
 
 
+ but set on paragraph properties not cell paragraphs -->
 
 fix
 
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index f77f603658e0..f1ba4ef19960 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -5360,7 +5360,7 @@ void SwUiWriterTest::testTdf113445()
 // Make sure that page 2 is on the right hand side of page 1, not below it.
 CPPUNIT_ASSERT_GREATER(nPage1Left, nPage2Left);
 
-// Insert a new paragaph at the start of the document.
+// Insert a new paragraph at the start of the document.
 SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
 pWrtShell->SttDoc();
 pWrtShell->SplitNode();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source sw/qa

2017-08-29 Thread Vasily Melenchuk
 filter/source/svg/svgwriter.cxx   |2 -
 sw/qa/extras/odfexport/data/tdf100492.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx  |   34 ++
 3 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit d3f1fa3cf190b83d585ec3d1b1a8e5b0896c8ea1
Author: Vasily Melenchuk 
Date:   Tue Jul 25 18:08:13 2017 +0300

tdf#100492 Skip empty shapes in SVG export

Some shapes do not contain polyline and meanwhile contain start/end
arrows. This is causing unexpected line endings appear in export.

TODO: Unittest is disabled, since XML parsing returns only root node
without children. So XPATH assert fails.

Change-Id: Ibc28f12b0f3838065978a674f0debe8e1b8103e9
Reviewed-on: https://gerrit.libreoffice.org/40422
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 069309f540c1..2bf4b1c0ad2d 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -3283,7 +3283,7 @@ void SVGActionWriter::ImplWriteActions( const 
GDIMetaFile& rMtf,
 }
 }
 
-if(mapCurShape.get() &&(aStartArrow.Count() || 
aEndArrow.Count()))
+if(mapCurShape.get() && 
mapCurShape->maShapePolyPoly.Count() && (aStartArrow.Count() || 
aEndArrow.Count()))
 {
 ImplWriteShape( *mapCurShape );
 
diff --git a/sw/qa/extras/odfexport/data/tdf100492.odt 
b/sw/qa/extras/odfexport/data/tdf100492.odt
new file mode 100644
index ..e17bd67c5096
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf100492.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index bbebd6b24afc..cc096f406733 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -19,6 +19,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -32,6 +34,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 class Test : public SwModelTestBase
 {
@@ -1654,6 +1658,36 @@ DECLARE_ODFEXPORT_TEST(testImageMimetype, 
"image-mimetype.odt")
 }
 }
 
+DECLARE_ODFEXPORT_TEST(testTdf100492, "tdf100492.odt")
+{
+uno::Reference xShape = getShape(1);
+CPPUNIT_ASSERT(xShape.is());
+
+// Save the first shape to a SVG
+uno::Reference xGraphicExporter = 
drawing::GraphicExportFilter::create(comphelper::getProcessComponentContext());
+uno::Reference xSourceDoc(xShape, uno::UNO_QUERY);
+xGraphicExporter->setSourceDocument(xSourceDoc);
+
+SvMemoryStream aStream;
+uno::Reference xOutputStream(new 
utl::OStreamWrapper(aStream));
+uno::Sequence aDescriptor( 
comphelper::InitPropertySequence({
+{ "OutputStream", uno::Any(xOutputStream) },
+{ "FilterName", uno::Any(OUString("SVG")) }
+}));
+xGraphicExporter->filter(aDescriptor);
+aStream.Seek(STREAM_SEEK_TO_BEGIN);
+
+// TODO: Disabled. Parsing of SVG gives just root node without any 
children.
+// Reason of such behavior unclear. So XPATH assert fails.
+
+// Parse resulting SVG as XML file.
+// xmlDocPtr pXmlDoc = parseXmlStream();
+
+// Check amount of paths required to draw an arrow.
+// Since there are still some emty paths in output test can fail later. 
There are just two
+// really used and visible paths.
+//assertXPath(pXmlDoc, "/svg/path", 4);
+}
 
 #endif
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source sw/qa

2017-08-09 Thread Szymon Kłos
 filter/source/msfilter/msdffimp.cxx   |2 +-
 sw/qa/extras/ww8export/data/tdf111480.doc |binary
 sw/qa/extras/ww8export/ww8export2.cxx |9 +
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 2b562f7531d097def1cf312f13df2fe9e9789ebe
Author: Szymon Kłos 
Date:   Wed Aug 9 12:15:53 2017 +0200

tdf#111480 Circular text was imported horizontally

Change-Id: I84a6c3a30fd1dddf104ad8bf037a5e0b2a90d376
Reviewed-on: https://gerrit.libreoffice.org/40912
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index adbd3d41b9a3..5360f750da48 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4407,7 +4407,7 @@ SdrObject* SvxMSDffManager::ImportShape( const 
DffRecordHeader& rHd, SvStream& r
 aFont.SetFamilyName( aFontName );
 auto nTextWidth = pOut->GetTextWidth( aObjectText );
 
-if ( nTextWidth )
+if ( nTextWidth && aObjData.eShapeType == 
mso_sptTextPlainText )
 {
 fRatio = aFont.GetFontSize().Height();
 fRatio /= nTextWidth;
diff --git a/sw/qa/extras/ww8export/data/tdf111480.doc 
b/sw/qa/extras/ww8export/data/tdf111480.doc
new file mode 100755
index ..888126066624
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf111480.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx 
b/sw/qa/extras/ww8export/ww8export2.cxx
index 70aa498d5fdc..7ace54f52f61 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -162,6 +162,15 @@ DECLARE_WW8EXPORT_TEST(testTdf91687, "tdf91687.doc")
 CPPUNIT_ASSERT_EQUAL((sal_Int32)18105, xWatermark->getSize().Width);
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf111480, "tdf111480.doc")
+{
+// Circular text was imported horizontally
+uno::Reference xText = getShape(1);
+
+CPPUNIT_ASSERT(xText->getSize().Height > 11000);
+CPPUNIT_ASSERT(xText->getSize().Width  > 11000);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source sw/qa xmloff/source

2017-07-27 Thread Samuel Mehrbrodt
 filter/source/xslt/odf2xhtml/export/common/body.xsl |   52 +++-
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl  |3 -
 sw/qa/extras/odfexport/data/image-mimetype.odt  |binary
 sw/qa/extras/odfexport/odfexport.cxx|   11 
 xmloff/source/text/txtparae.cxx |   26 ++
 5 files changed, 69 insertions(+), 23 deletions(-)

New commits:
commit 4469b29faeb8dbf7793a5d81d9c5ddebacf3015f
Author: Samuel Mehrbrodt 
Date:   Mon Jul 24 15:46:06 2017 +0200

tdf#109202 Add mimetype to image element

Browsers don't recognize base64 svg if the mimetype is missing.
So we add the image mimetype to our flat odf export, which the xhtml
export uses and transforms it into an xhtml document.

Change-Id: I21aafdb97b4104e14e2d40abda73a526bb37041a
Reviewed-on: https://gerrit.libreoffice.org/40371
Reviewed-by: Michael Stahl 
Tested-by: Samuel Mehrbrodt 

diff --git a/filter/source/xslt/odf2xhtml/export/common/body.xsl 
b/filter/source/xslt/odf2xhtml/export/common/body.xsl
index 3196facc8092..05b78a5ed43e 100644
--- a/filter/source/xslt/odf2xhtml/export/common/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/body.xsl
@@ -1,21 +1,21 @@
 
-
+
 
@@ -317,6 +317,7 @@
 


+   
 


@@ -332,7 +333,14 @@



-   
data:image/*;base64,
+
+
+data:;base64,
+
+
+data:image/*;base64,
+
+



@@ -361,10 +369,10 @@


 
-
-  
-  
-
+
+  
+  
+



diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 823d048254c5..d638f6294ad9 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -19,7 +19,7 @@
 
-http://www.w3.org/1999/XSL/Transform; 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:oooc="http://openoffice.org/2004/calc; 
xmlns:ooow="http://openoffice.org/2004/writer; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:s
 tyle="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:xforms="http://www.w3.org/2002/xforms; 
xmlns:xlink="http://www.w3.org/1999/xlink; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:xt="http://www.jclark.com/xt; xmlns:common="http://exslt.org/common; 
xmlns:xalan="http://xml.apache.org/xalan; exclude-result-prefixes="chart config 
dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg 
table text xforms xlink xsd xsi xt common xalan" 
xmlns="http://www.w3.org/1999/xhtml;>
+http://www.w3.org/1999/XSL/Transform; 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/; 

[Libreoffice-commits] core.git: filter/source sw/qa

2014-01-15 Thread Miklos Vajna
 filter/source/msfilter/util.cxx   |  116 +-
 sw/qa/extras/ooxmlexport/data/mso-spt180.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx  |   15 +++
 3 files changed, 73 insertions(+), 58 deletions(-)

New commits:
commit 6e216adedd1a131808b874784c36141607264eac
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jan 15 13:02:52 2014 +0100

filter: audit customshape type - drawingML preset shape table

It turns out that this table contained entries which are not valid
drawingML preset shape names.

Invalid entries are now either have a valid name instead (based on the
oox/source/export/preset-definitions-to-shape-types.pl mapping, which
already tries to map VML shape ID's to drawingML preset strings), or in
case I found no mapping there, the entry is now simply commented out.

It's still better to fall back to export a shape as a rectangle than
corrupting the whole document.

Change-Id: Ic2d8926e5819f3312aaca55d50a1492332e52a9d

diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index efe8cd1..72e15dd 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -720,14 +720,14 @@ static const CustomShapeTypeTranslationTable 
pCustomShapeTypeTranslationTable[]
 { mso-spt21, plaque },
 { can, can },
 { ring, donut },
-{ mso-spt24, textSimple },
-{ mso-spt25, textOctagon },
-{ mso-spt26, textHexagon },
-{ mso-spt27, textCurve },
-{ mso-spt28, textWave },
-{ mso-spt29, textRing },
-{ mso-spt30, textOnCurve },
-{ mso-spt31, textOnRing },
+{ mso-spt24, textPlain },
+{ mso-spt25, textStop },
+{ mso-spt26, textTriangle },
+{ mso-spt27, textCanDown },
+{ mso-spt28, textWave1 },
+{ mso-spt29, textArchUpPour },
+{ mso-spt30, textCanDown },
+{ mso-spt31, textArchUp },
 { mso-spt32, straightConnector1 },
 { mso-spt33, bentConnector2 },
 { mso-spt34, bentConnector3 },
@@ -746,7 +746,7 @@ static const CustomShapeTypeTranslationTable 
pCustomShapeTypeTranslationTable[]
 { line-callout-1, borderCallout1 },
 { line-callout-2, borderCallout2 },
 { line-callout-3, borderCallout3 },
-{ mso-spt49, accentBorderCallout90 },
+{ mso-spt49, borderCallout3 },
 { mso-spt50, accentBorderCallout1 },
 { mso-spt51, accentBorderCallout2 },
 { mso-spt52, accentBorderCallout3 },
@@ -755,9 +755,9 @@ static const CustomShapeTypeTranslationTable 
pCustomShapeTypeTranslationTable[]
 { chevron, chevron },
 { pentagon, pentagon },
 { forbidden, noSmoking },
-{ star8, seal8 },
-{ mso-spt59, seal16 },
-{ mso-spt60, seal32 },
+{ star8, star8 },
+{ mso-spt59, star16 },
+{ mso-spt60, star32 },
 { rectangular-callout, wedgeRectCallout },
 { round-rectangular-callout, wedgeRoundRectCallout },
 { round-callout, wedgeEllipseCallout },
@@ -788,7 +788,7 @@ static const CustomShapeTypeTranslationTable 
pCustomShapeTypeTranslationTable[]
 { mso-spt89, leftUpArrow },
 { mso-spt90, bentUpArrow },
 { mso-spt91, bentArrow },
-{ star24, seal24 },
+{ star24, star24 },
 { striped-right-arrow, stripedRightArrow },
 { notched-right-arrow, notchedRightArrow },
 { block-arc, blockArc },
@@ -832,57 +832,57 @@ static const CustomShapeTypeTranslationTable 
pCustomShapeTypeTranslationTable[]
 { flowchart-direct-access-storage, flowChartMagneticDrum },
 { flowchart-display, flowChartDisplay },
 { flowchart-delay, flowChartDelay },
-{ fontwork-plain-text, textPlainText },
-{ fontwork-stop, textStop },
-{ fontwork-triangle-up, textTriangle },
-{ fontwork-triangle-down, textTriangleInverted },
-{ fontwork-chevron-up, textChevron },
-{ fontwork-chevron-down, textChevronInverted },
-{ mso-spt142, textRingInside },
-{ mso-spt143, textRingOutside },
-{ fontwork-arch-up-curve, textArchUpCurve },
-{ fontwork-arch-down-curve, textArchDownCurve },
-{ fontwork-circle-curve, textCircleCurve },
-{ fontwork-open-circle-curve, textButtonCurve },
-{ fontwork-arch-up-pour, textArchUpPour },
-{ fontwork-arch-down-pour, textArchDownPour },
-{ fontwork-circle-pour, textCirclePour },
-{ fontwork-open-circle-pour, textButtonPour },
-{ fontwork-curve-up, textCurveUp },
-{ fontwork-curve-down, textCurveDown },
-{ fontwork-fade-up-and-right, textCascadeUp },
-{ fontwork-fade-up-and-left, textCascadeDown },
-{ fontwork-wave, textWave1 },
-{ mso-spt157, textWave2 },
-{ mso-spt158, textWave3 },
-{ mso-spt159, textWave4 },
-{ fontwork-inflate, textInflate },
-{ mso-spt161, textDeflate },
-{ mso-spt162, textInflateBottom },
-{ mso-spt163, textDeflateBottom },
-{ mso-spt164, textInflateTop },
-{ mso-spt165, textDeflateTop },
-{ mso-spt166, textDeflateInflate },
-{ mso-spt167, textDeflateInflateDeflate },
-{ 

[Libreoffice-commits] core.git: filter/source sw/qa

2014-01-02 Thread Miklos Vajna
 filter/source/msfilter/util.cxx |1 -
 sw/qa/extras/ooxmlexport/data/fdo73215.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx|   11 +++
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 096ea63090b137ac52cb75bf4b53dcef31962d44
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Jan 2 15:44:11 2014 +0100

fdo#73215 filter: don't try to handle pictureFrame in 
GetOOXMLPresetGeometry()

pictureFrame is not a valid drawingML shape type, VML export used to
write just rect, by removing an explicit entry for
ESCHER_ShpInst_PictureFrame we now do the same.

Change-Id: I57683b7f5f80bfef8c3b6fb9ae9f33e4599a7eb2

diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index bf5648d..efe8cd1 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -772,7 +772,6 @@ static const CustomShapeTypeTranslationTable 
pCustomShapeTypeTranslationTable[]
 { bang, irregularSeal2 },
 { lightning, lightningBolt },
 { heart, heart },
-{ mso-spt75, pictureFrame },
 { quad-arrow, quadArrow },
 { left-arrow-callout, leftArrowCallout },
 { right-arrow-callout, rightArrowCallout },
diff --git a/sw/qa/extras/ooxmlexport/data/fdo73215.docx 
b/sw/qa/extras/ooxmlexport/data/fdo73215.docx
new file mode 100644
index 000..9b2c05b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo73215.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 54042d4..7e1b91d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -136,6 +136,7 @@ xmlNodeSetPtr Test::getXPathNode(xmlDocPtr pXmlDoc, const 
OString rXPath)
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST(v), 
BAD_CAST(urn:schemas-microsoft-com:vml));
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST(mc), 
BAD_CAST(http://schemas.openxmlformats.org/markup-compatibility/2006;));
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST(wps), 
BAD_CAST(http://schemas.microsoft.com/office/word/2010/wordprocessingShape;));
+xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST(wpg), 
BAD_CAST(http://schemas.microsoft.com/office/word/2010/wordprocessingGroup;));
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST(wp), 
BAD_CAST(http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing;));
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST(a), 
BAD_CAST(http://schemas.openxmlformats.org/drawingml/2006/main;));
 xmlXPathObjectPtr pXmlXpathObj = 
xmlXPathEvalExpression(BAD_CAST(rXPath.getStr()), pXmlXpathCtx);
@@ -2183,6 +2184,16 @@ DECLARE_OOXMLEXPORT_TEST(testBezier, bezier.odt)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDraws-getCount());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testFdo73215, fdo73215.docx)
+{
+xmlDocPtr pXmlDoc = parseExport(word/document.xml);
+if (!pXmlDoc)
+return;
+// 'rect' was 'pictureFrame', which isn't valid.
+assertXPath(pXmlDoc, 
/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:prstGeom,
+prst, rect);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedParagraphMark, 
testTrackChangesDeletedParagraphMark.docx)
 {
 xmlDocPtr pXmlDoc = parseExport(word/document.xml);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits