[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sw/qa sw/source

2015-01-08 Thread Michael Stahl
 sw/qa/extras/odfimport/data/fdo79269.odt|binary
 sw/qa/extras/odfimport/data/fdo79269_header.odt |binary
 sw/qa/extras/odfimport/odfimport.cxx|   35 
 sw/source/core/unocore/unostyle.cxx |   35 +---
 4 files changed, 55 insertions(+), 15 deletions(-)

New commits:
commit 6c64dfb95cf4b23627e5d5ead930c089f2ebb50c
Author: Michael Stahl mst...@redhat.com
Date:   Tue Sep 30 17:59:08 2014 +0200

fdo#79269: fix ODF import of style:footer-first

The implementation of SwXStyle's FirstIsShared property is busted, and
that causes xmloff to write the footer-first content into the master
footer.

This is a re-implementation of 0f21f932081471b2a5eda820fa1a194fbf3ab85c
because unostyle.cxx is very different on master...

Reviewed-on: https://gerrit.libreoffice.org/11722
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk
(cherry picked from commit 902de8a1cbdb86c1eb1a05c8307b109fd75f493c)

Conflicts:
sw/source/core/unocore/unostyle.cxx

Change-Id: I485d8089c1fb5ba3ca369fbfe8f3115bf700ba13
Reviewed-on: https://gerrit.libreoffice.org/11752
Reviewed-by: Björn Michaelsen bjoern.michael...@canonical.com
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/odfimport/data/fdo79269.odt 
b/sw/qa/extras/odfimport/data/fdo79269.odt
new file mode 100644
index 000..2e3bf1e
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo79269.odt differ
diff --git a/sw/qa/extras/odfimport/data/fdo79269_header.odt 
b/sw/qa/extras/odfimport/data/fdo79269_header.odt
new file mode 100644
index 000..6f1a839
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo79269_header.odt 
differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx 
b/sw/qa/extras/odfimport/odfimport.cxx
index f1651bd..4fa3600 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -272,6 +272,41 @@ DECLARE_ODFIMPORT_TEST(testFdo60842, fdo60842.odt)
 getCell(xTable, E1, 01/04/2012);
 }
 
+DECLARE_ODFIMPORT_TEST(testFdo79269, fdo79269.odt)
+{
+uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY);
+uno::Referencetext::XTextViewCursorSupplier 
xTextViewCursorSupplier(xModel-getCurrentController(), uno::UNO_QUERY);
+uno::Referencetext::XPageCursor 
xCursor(xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY);
+xCursor-jumpToLastPage();
+CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor-getPage());
+
+// The problem was that the first-footer was shared.
+uno::Referencebeans::XPropertySet 
xPropSet(getStyles(PageStyles)-getByName(DEFAULT_STYLE), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(false, getPropertybool(xPropSet, FirstIsShared));
+
+uno::Referencetext::XTextRange xFooter1 = getProperty 
uno::Referencetext::XTextRange (xPropSet, FooterTextFirst);
+CPPUNIT_ASSERT_EQUAL(OUString(forst), xFooter1-getString());
+uno::Referencetext::XTextRange xFooter = getProperty 
uno::Referencetext::XTextRange (xPropSet, FooterText);
+CPPUNIT_ASSERT_EQUAL(OUString(second), xFooter-getString());
+}
+
+DECLARE_ODFIMPORT_TEST(testFdo79269_header, fdo79269_header.odt)
+{
+uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY);
+uno::Referencetext::XTextViewCursorSupplier 
xTextViewCursorSupplier(xModel-getCurrentController(), uno::UNO_QUERY);
+uno::Referencetext::XPageCursor 
xCursor(xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY);
+xCursor-jumpToLastPage();
+CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor-getPage());
+
+uno::Referencebeans::XPropertySet 
xPropSet(getStyles(PageStyles)-getByName(DEFAULT_STYLE), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(false, getPropertybool(xPropSet, FirstIsShared));
+
+uno::Referencetext::XTextRange xFooter1 = getProperty 
uno::Referencetext::XTextRange (xPropSet, HeaderTextFirst);
+CPPUNIT_ASSERT_EQUAL(OUString(forst), xFooter1-getString());
+uno::Referencetext::XTextRange xFooter = getProperty 
uno::Referencetext::XTextRange (xPropSet, HeaderText);
+CPPUNIT_ASSERT_EQUAL(OUString(second), xFooter-getString());
+}
+
 DECLARE_ODFIMPORT_TEST(testFdo56272, fdo56272.odt)
 {
 uno::Referencedrawing::XShape xShape = getShape(1);
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index d5589ec..97d161c 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -467,6 +467,24 @@ SwXStyleFamily::~SwXStyleFamily()
 
 }
 
+static bool lcl_GetHeaderFooterItem(
+SfxItemSet const rSet, OUString const rPropName, bool const bFooter,
+SvxSetItem const* o_rpItem)
+{
+SfxItemState eState = rSet.GetItemState(
+(bFooter) ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
+false, reinterpret_castconst SfxPoolItem**(o_rpItem));
+   

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sw/qa sw/source

2014-07-27 Thread Rohit Deshmukh
 sw/qa/extras/ooxmlexport/data/testTitlePage.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |8 
 sw/source/filter/ww8/wrtw8sty.cxx|2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit f71749ac15d7e0851c73952a5d9b7b727d1cd262
Author: Rohit Deshmukh rohit.deshm...@synerzip.com
Date:   Wed Jan 22 18:03:21 2014 +0530

Fix for Footer is missing if fisrt page different header/footer is set

Reviewed on:
https://gerrit.libreoffice.org/7589

Signed-off-by: Luboš Luňák l.lu...@collabora.com

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx

Change-Id: I2a2f2abc0dcf5542b7b950f9a232d7155a055fdd

diff --git a/sw/qa/extras/ooxmlexport/data/testTitlePage.docx 
b/sw/qa/extras/ooxmlexport/data/testTitlePage.docx
new file mode 100644
index 000..72bfdf8
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/testTitlePage.docx 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 460d497..ea37815 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2088,6 +2088,14 @@ DECLARE_OOXMLEXPORT_TEST(testBnc884615, bnc884615.docx)
 CPPUNIT_ASSERT_EQUAL(false, bool(getPropertysal_Bool(getShape(1), 
Opaque)));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTestTitlePage, testTitlePage.docx)
+{
+xmlDocPtr pXmlDoc = parseExport(word/document.xml);
+if (!pXmlDoc)
+return;
+assertXPathChildren(pXmlDoc, /w:document/w:body/w:sectPr/w:titlePg, 0);
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 2675cc5..a4edf4b 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1748,7 +1748,7 @@ void MSWordExportBase::SectionProperties( const 
WW8_SepInfo rSepInfo, WW8_PdAtt
 {
 const SwPageDesc *pFollow = pPd-GetFollow();
 const SwFrmFmt rFollowFmt = pFollow-GetMaster();
-if ( sw::util::IsPlausableSingleWordSection( *pPdFirstPgFmt, 
rFollowFmt ) )
+if ( sw::util::IsPlausableSingleWordSection( *pPdFirstPgFmt, 
rFollowFmt ) || titlePage )
 {
 if (rSepInfo.pPDNd)
 pPdFirstPgFmt = pPd-GetPageFmtOfNode( *rSepInfo.pPDNd );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sw/qa sw/source

2014-07-16 Thread Zolnai Tamás
 sw/qa/extras/ww8import/data/fdo80333.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx |9 +
 sw/source/filter/ww8/ww8par6.cxx |   24 ++--
 3 files changed, 23 insertions(+), 10 deletions(-)

New commits:
commit f60bff6af14afce4db1d76d50a1586fb0fb23cbf
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Sat Jul 12 12:42:42 2014 +0200

fdo#80333: .doc has large black rectangles between paragraphs

These black rectangles are character border shadows, because checking
whether there is a border at all was missing. In Word there
is no shadow without a border.

Regression from aa2faee4b3954b57a613963b501ecf611b3a14ca

(cherry picked from commit c2e708d61746a259888c0e5fb1d3e9a43e3ca696)

Change-Id: Ib3cb4e904fdd33f215c81d7c02762a196f484b1b
Reviewed-on: https://gerrit.libreoffice.org/10250
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/sw/qa/extras/ww8import/data/fdo80333.doc 
b/sw/qa/extras/ww8import/data/fdo80333.doc
new file mode 100644
index 000..773a922
Binary files /dev/null and b/sw/qa/extras/ww8import/data/fdo80333.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 0d360d8..6a48abf 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -15,6 +15,7 @@
 #include com/sun/star/text/XDependentTextField.hpp
 #include com/sun/star/text/XTextFramesSupplier.hpp
 #include com/sun/star/text/XTextTablesSupplier.hpp
+#include com/sun/star/table/ShadowFormat.hpp
 
 #include vcl/svapp.hxx
 
@@ -325,6 +326,14 @@ DECLARE_WW8IMPORT_TEST(testFdo77844, fdo77844.doc)
 #endif
 }
 
+DECLARE_WW8IMPORT_TEST(testFdp80333, fdo80333.doc)
+{
+// Despite there is no character border, border shadow was imported
+uno::Referencebeans::XPropertySet xRun(getRun(getParagraph(1),1), 
uno::UNO_QUERY);
+const table::ShadowFormat aShadow = getPropertytable::ShadowFormat(xRun, 
CharShadowFormat);
+CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_NONE, aShadow.Location);
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 066b8db..0324552 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -4778,16 +4778,20 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 
/*nId*/, const sal_uInt8* pData
 WW8_BRC aBrc;
 _SetWW8_BRC(bVer67, aBrc, pData);
 
-Set1Border(bVer67, aBoxItem, aBrc, BOX_LINE_TOP, 0, 0, true);
-Set1Border(bVer67, aBoxItem, aBrc, BOX_LINE_BOTTOM, 0, 0, true);
-Set1Border(bVer67, aBoxItem, aBrc, BOX_LINE_LEFT, 0, 0, true);
-Set1Border(bVer67, aBoxItem, aBrc, BOX_LINE_RIGHT, 0, 0, true);
-NewAttr( aBoxItem );
-
-short aSizeArray[WW8_RIGHT+1]={0}; aSizeArray[WW8_RIGHT] = 1;
-SvxShadowItem aShadowItem(RES_CHRATR_SHADOW);
-if( SetShadow( aShadowItem, aSizeArray[0], aBrc ) )
-NewAttr( aShadowItem );
+// WW8_BRC is empty - no border, no shadow
+if( !aBrc.IsEmpty(bVer67) )
+{
+Set1Border(bVer67, aBoxItem, aBrc, BOX_LINE_TOP, 0, 0, true);
+Set1Border(bVer67, aBoxItem, aBrc, BOX_LINE_BOTTOM, 0, 0, 
true);
+Set1Border(bVer67, aBoxItem, aBrc, BOX_LINE_LEFT, 0, 0, true);
+Set1Border(bVer67, aBoxItem, aBrc, BOX_LINE_RIGHT, 0, 0, true);
+NewAttr( aBoxItem );
+
+short aSizeArray[WW8_RIGHT+1]={0}; aSizeArray[WW8_RIGHT] = 1;
+SvxShadowItem aShadowItem(RES_CHRATR_SHADOW);
+if( SetShadow( aShadowItem, aSizeArray[0], aBrc ) )
+NewAttr( aShadowItem );
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sw/qa sw/source

2014-04-22 Thread YogeshBharate
 sw/qa/extras/ooxmlexport/data/fdo71785.docx   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx  |6 ++
 sw/source/filter/ww8/docxtablestyleexport.cxx |   20 ++--
 3 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit d6e66af53ccbb6e15925a14c9283a8ada92ebc5f
Author: YogeshBharate yogesh.bhar...@synerzip.com
Date:   Fri Nov 29 18:02:54 2013 +0530

fdo#71785:  File hangs LibreOffice on Save

Problem Description: While saving the file LO shows the error
This file could not be save.
The root cause was memory leak.

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/6850

(cherry picked from commit 0f6240fa92c443f66441545438821c02b3412486)
Signed-off-by: Andras Timar andras.ti...@collabora.com

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx

Change-Id: Iacc185780c14760056a7d690eb113d4dde1de034

diff --git a/sw/qa/extras/ooxmlexport/data/fdo71785.docx 
b/sw/qa/extras/ooxmlexport/data/fdo71785.docx
new file mode 100644
index 000..e155e83
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo71785.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index b8b104b..7095ea2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2042,6 +2042,12 @@ DECLARE_OOXMLEXPORT_TEST(testExtraSectionBreak, 
1_page.docx)
 CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor-getPage());
 }
 
+
+DECLARE_OOXMLEXPORT_TEST(testFdo71785, fdo71785.docx)
+{
+// crashtest
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx 
b/sw/source/filter/ww8/docxtablestyleexport.cxx
index af96d5f..663898e4 100644
--- a/sw/source/filter/ww8/docxtablestyleexport.cxx
+++ b/sw/source/filter/ww8/docxtablestyleexport.cxx
@@ -342,7 +342,8 @@ void 
DocxTableStyleExport::Impl::tableStyleRPr(uno::Sequencebeans::PropertyValu
 
 m_pSerializer-startElementNS(XML_w, XML_rPr, FSEND);
 
-uno::Sequencebeans::PropertyValue aRFonts, aLang, aColor;
+uno::Sequencebeans::PropertyValue aRFonts, aLang, aColor, 
aSpacingSequence;
+bool bSequenceFlag = false ;
 OUString aB, aBCs, aI, aSz, aSzCs, aCaps, aSmallCaps, aSpacing;
 for (sal_Int32 i = 0; i  rRPr.getLength(); ++i)
 {
@@ -367,7 +368,16 @@ void 
DocxTableStyleExport::Impl::tableStyleRPr(uno::Sequencebeans::PropertyValu
 else if (rRPr[i].Name == smallCaps)
 aSmallCaps = rRPr[i].Value.getOUString();
 else if (rRPr[i].Name == spacing)
-aSpacing = rRPr[i].Value.getOUString();
+{
+if (rRPr[i].Value.hasOUString())
+{
+aSpacing = rRPr[i].Value.getOUString();
+}
+else {
+aSpacingSequence = rRPr[i].Value.get 
uno::Sequencebeans::PropertyValue () ;
+bSequenceFlag = true ; // set the uno::Sequence flag.
+}
+}
 }
 tableStyleRRFonts(aRFonts);
 tableStyleRLang(aLang);
@@ -377,6 +387,12 @@ void 
DocxTableStyleExport::Impl::tableStyleRPr(uno::Sequencebeans::PropertyValu
 handleBoolean(aCaps, XML_caps);
 handleBoolean(aSmallCaps, XML_smallCaps);
 tableStyleRColor(aColor);
+if(bSequenceFlag)
+{
+   m_pSerializer-singleElementNS(XML_w, XML_spacing,
+FSNS(XML_w, 
XML_val),OUStringToOString(aSpacingSequence[0].Value.getOUString(), 
RTL_TEXTENCODING_UTF8).getStr(),
+   FSEND);
+}
 if (!aSpacing.isEmpty())
 m_pSerializer-singleElementNS(XML_w, XML_spacing,
 FSNS(XML_w, XML_val), OUStringToOString(aSpacing, 
RTL_TEXTENCODING_UTF8).getStr(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits