[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2015-04-13 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/tdf75614.rtf   |   18 ++
 sw/qa/extras/rtfimport/rtfimport.cxx   |6 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |6 +-
 3 files changed, 29 insertions(+), 1 deletion(-)

New commits:
commit dee3f93a9e82fe320ce2de7078a32ecaa25e9c1b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Apr 12 15:01:23 2015 +0200

tdf#75614 RTF import: fix missing text after footnote

(cherry picked from commit cec5f2eab25578a9859134d697c200089c597faa)

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

Change-Id: I5901094cb603c35a1cd8ac718fd434a9dd55729b
Reviewed-on: https://gerrit.libreoffice.org/15271
Tested-by: David Tardon dtar...@redhat.com
Reviewed-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/tdf75614.rtf 
b/sw/qa/extras/rtfimport/data/tdf75614.rtf
new file mode 100644
index 000..1233801
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf75614.rtf
@@ -0,0 +1,18 @@
+{\rtf1\ansi\ansicpg0\uc1\deff0\deflang0\deflangfe0\fet2
+{\*\ftnsep\pard\plain\chftnsep }
+{\*\ftnsepc\pard\plain\chftnsepc}
+\paperw8391\paperh11906\margl567\margr567\margt567\margb567\headery567\footery6\viewscale150\viewzk0
+{\fonttbl
+{\f0\fnil Arial;}
+{\f1\fnil\fcharset204 times new roman;}
+{\f2\fnil\fcharset204 cambria;}
+{\f3\fnil\fcharset238 cambria;}
+{\f4\fnil\fcharset0 cambria;}
+{\f5\fnil\fcharset204 courier new;}
+{\f6\fnil\fcharset204 arial;}
+}
+{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
+\pard\plain Before\plain \super \chftn
+{\footnote
+\pard Footnote.}
+\plain after.\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 41a1064..f269f0a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2103,6 +2103,12 @@ DECLARE_RTFIMPORT_TEST(testTdf88811, tdf88811.rtf)
 CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(4), xDrawPage-getCount());
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo75614, tdf75614.rtf)
+{
+// Text after the footnote was missing, so this resulted in a 
css::container::NoSuchElementException.
+CPPUNIT_ASSERT_EQUAL(OUString(after.), getRun(getParagraph(1), 
3)-getString());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 447493c..a652b9c 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2322,8 +2322,12 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
 }
 break;
 case RTF_CHFTN:
-// Nothing to do, dmapper assumes this is the default.
+{
+if (m_aStates.top().pCurrentBuffer == m_aSuperBuffer)
+// Stop buffering, there will be no custom mark for this footnote 
or endnote.
+m_aStates.top().pCurrentBuffer = 0;
 break;
+}
 case RTF_PAGE:
 {
 // Ignore page breaks inside tables.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa

2015-03-31 Thread Stephan Bergmann
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 483d1f871b30bcd24b9b7fa3034673649cf53e9a
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jan 21 14:51:11 2015 +0100

RotateAngle of UNO type long

Change-Id: Id3aec16d17b55366c2a35810b21b0a1c73439741
(cherry picked from commit 44b2fb6d0ba8c3fc8aa6edb4e539c484e21b7fc5)

diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index c4bc13a..a6ba627 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2423,7 +2423,7 @@ DECLARE_OOXMLIMPORT_TEST(testFdo87488, fdo87488.docx)
 {
 uno::Referencebeans::XPropertySet props(group-getByIndex(0), 
uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(props-getPropertyValue(RotateAngle),
- uno::makeAny(270 * 100));
+ uno::makeAnysal_Int32(270 * 100));
 comphelper::SequenceAsHashMap 
geom(props-getPropertyValue(CustomShapeGeometry));
 CPPUNIT_ASSERT_EQUAL(sal_Int32(90), 
geom[TextPreRotateAngle].getsal_Int32());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2015-02-27 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/tdf88811.rtf |   26 ++
 sw/qa/extras/rtfimport/rtfimport.cxx |8 
 sw/source/core/unocore/unotext.cxx   |   13 ++---
 3 files changed, 44 insertions(+), 3 deletions(-)

New commits:
commit c56abb3c952e3062099d32702719825ee55b5112
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Feb 3 12:29:21 2015 +0100

tdf#88811 SwXText::convertToTextFrame: handle shapes anchored to us

(cherry picked from commit 38f2b8b3b16aab19a2564ec699d253d3dccecc3c)

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

Change-Id: Iedf8eacd37b8ed8e307a10e8ade32f53c7417c4a
Reviewed-on: https://gerrit.libreoffice.org/14629
Tested-by: Caolán McNamara caol...@redhat.com
Reviewed-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/tdf88811.rtf 
b/sw/qa/extras/rtfimport/data/tdf88811.rtf
new file mode 100644
index 000..a20835c
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf88811.rtf
@@ -0,0 +1,26 @@
+{\rtf1\ansi\deff0
+\margl0\margr0\margt0\margb0
+\paperw11905\paperh16837
+{\shp
+{\*\shpinst\shpleft4420\shptop2720\shpright4420\shpbottom3280\shpfhdr0\shpbxpage\shpbypage\shpwr3\shpwrk0\shpfblwtxt1\shpz0
+{\sp
+{\sn shapeType}
+{\sv 20}
+}
+}
+}
+{\pard\plain\ql\sl-180\sb40\phmrg\pvmrg\posx3520\posy2900\absw680\absh0\dxfrtext0\dfrmtxtx0\dfrmtxty0
+{\f1\fs18\b Frame1}
+\par}
+{\shp
+{\*\shpinst\shpleft5760\shptop2720\shpright5760\shpbottom3280\shpfhdr0\shpbxpage\shpbypage\shpwr3\shpwrk0\shpfblwtxt1\shpz0
+{\sp
+{\sn shapeType}
+{\sv 20}
+}
+}
+}
+{\pard\plain\ql\sl-180\sb40\phmrg\pvmrg\posx4800\posy2900\absw800\absh0\dxfrtext0\dfrmtxtx0\dfrmtxty0
+{\f1\fs18\b Frame2}
+\par}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index db67a12..41a1064 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2095,6 +2095,14 @@ DECLARE_RTFIMPORT_TEST(testFdo82114, fdo82114.rtf)
 CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf88811, tdf88811.rtf)
+{
+// The problem was that shapes anchored to the paragraph that is moved 
into a textframe were lost, so this was 2.
+uno::Referencedrawing::XDrawPageSupplier xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencedrawing::XDrawPage xDrawPage = 
xDrawPageSupplier-getDrawPage();
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(4), xDrawPage-getCount());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index cd31f50..25dd3f5 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1658,14 +1658,21 @@ SwXText::convertToTextFrame(
 
 // see if there are frames already anchored to this node
 std::setOUString aAnchoredFrames;
+// for shapes, we have to work with the SdrObjects, as unique name is not 
guaranteed in their frame format
+std::setconst SdrObject* aAnchoredShapes;
 for (size_t i = 0; i  m_pImpl-m_pDoc-GetSpzFrmFmts()-size(); ++i)
 {
 SwFrmFmt* pFrmFmt = (*m_pImpl-m_pDoc-GetSpzFrmFmts())[i];
 const SwFmtAnchor rAnchor = pFrmFmt-GetAnchor();
-if (FLY_AT_PARA == rAnchor.GetAnchorId() 
+if ((FLY_AT_PARA == rAnchor.GetAnchorId() || FLY_AT_CHAR == 
rAnchor.GetAnchorId()) 
 aStartPam.Start()-nNode.GetIndex() = 
rAnchor.GetCntntAnchor()-nNode.GetIndex() 
 aStartPam.End()-nNode.GetIndex() = 
rAnchor.GetCntntAnchor()-nNode.GetIndex())
-aAnchoredFrames.insert(pFrmFmt-GetName());
+{
+if (pFrmFmt-Which() == RES_DRAWFRMFMT)
+aAnchoredShapes.insert(pFrmFmt-FindSdrObject());
+else
+aAnchoredFrames.insert(pFrmFmt-GetName());
+}
 }
 
 SwXTextFrame *const pNewFrame = new SwXTextFrame(m_pImpl-m_pDoc);
@@ -1708,7 +1715,7 @@ SwXText::convertToTextFrame(
 for (size_t i = 0; i  
m_pImpl-m_pDoc-GetSpzFrmFmts()-size(); ++i)
 {
 SwFrmFmt* pFrmFmt = 
(*m_pImpl-m_pDoc-GetSpzFrmFmts())[i];
-if( aAnchoredFrames.find( pFrmFmt-GetName() ) != 
aAnchoredFrames.end() )
+if (aAnchoredFrames.find(pFrmFmt-GetName()) != 
aAnchoredFrames.end() || aAnchoredShapes.find(pFrmFmt-FindSdrObject()) != 
aAnchoredShapes.end())
 {
 // copy the anchor to the next paragraph
 SwFmtAnchor aAnchor(pFrmFmt-GetAnchor());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2015-02-09 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo82114.rtf|   14 ++
 sw/qa/extras/rtfimport/rtfimport.cxx|9 +
 writerfilter/source/dmapper/PropertyMap.cxx |   13 +
 3 files changed, 32 insertions(+), 4 deletions(-)

New commits:
commit d522ecb71ed1c5cb8472eee0b3bbd6a5fe6fed3e
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Sep 11 12:23:18 2014 +0200

Resolves: fdo#88784 crash on loading certain docx

was/also:

fdo#82114 RTF import: fix handling of first page in non-first section

(cherry picked from commit 04fe5e6a31c9701177a744bbc8a53b2f664fe71c)

Change-Id: If06c6bcdda97447e6014223d997c7ff8abd64b48
Reviewed-on: https://gerrit.libreoffice.org/14377
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo82114.rtf 
b/sw/qa/extras/rtfimport/data/fdo82114.rtf
new file mode 100644
index 000..073d281
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo82114.rtf
@@ -0,0 +1,14 @@
+{\rtf1
+\paperw11906\paperh16838\margl1134\margr567\margt1418\margb851\gutter0\ltrsect
+\viewkind1\viewscale110\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nojkernpunct\rsidroot13516616\utinl
 \fet0
+\titlepg
+{\headerr Right page header, section 1\par
+}
+{\headerf First page header, section 1\par
+}
+\pard\plain First page, section 1.\par\sect
+\sectd\titlepg
+{\headerf First page header, section 2\par
+}
+\pard\plain First page, section 2.\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 2cdbcbc..db67a12 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2086,6 +2086,15 @@ DECLARE_RTFIMPORT_TEST(testFdo86750, fdo86750.rtf)
 CPPUNIT_ASSERT_EQUAL(OUString(#anchor), 
getPropertyOUString(getRun(getParagraph(1), 1), HyperLinkURL));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo82114, fdo82114.rtf)
+{
+uno::Referencetext::XText xHeaderText = getProperty 
uno::Referencetext::XText (getStyles(PageStyles)-getByName(Converted1), 
HeaderText);
+OUString aActual = xHeaderText-getString();
+OUString aExpected(First page header, section 2);
+// This was 'Right page header, section 1'.
+CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 5014d63..1ae318d 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -428,14 +428,18 @@ uno::Reference beans::XPropertySet  
SectionPropertyMap::GetPageStyle(
 m_aFirstPageStyle = uno::Reference beans::XPropertySet  (
 
xTextFactory-createInstance(com.sun.star.style.PageStyle),
 uno::UNO_QUERY);
+
+// Call insertByName() before GetPageStyle(), otherwise the
+// first and the follow page style will have the same name, and
+// insertByName() will fail.
+if (xPageStyles.is())
+xPageStyles-insertByName( m_sFirstPageStyleName, 
uno::makeAny(m_aFirstPageStyle) );
+
 // Ensure that m_aFollowPageStyle has been created
 GetPageStyle( xPageStyles, xTextFactory, false );
 // Chain m_aFollowPageStyle to be after m_aFirstPageStyle
 m_aFirstPageStyle-setPropertyValue(FollowStyle,
 uno::makeAny(m_sFollowPageStyleName));
-
-if (xPageStyles.is())
-xPageStyles-insertByName( m_sFirstPageStyleName, 
uno::makeAny(m_aFirstPageStyle) );
 }
 else if( !m_aFirstPageStyle.is()  xPageStyles.is() )
 {
@@ -462,8 +466,9 @@ uno::Reference beans::XPropertySet  
SectionPropertyMap::GetPageStyle(
 }
 
 }
-catch( const uno::Exception )
+catch( const uno::Exception rException )
 {
+SAL_WARN(writerfilter, SectionPropertyMap::GetPageStyle() failed:  
 rException.Message);
 }
 
 return xRet;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2015-01-22 Thread Caolán McNamara
 sw/qa/core/data/html/pass/fdo87601-1.html |  100 ++
 sw/source/filter/html/swhtml.cxx  |2 
 2 files changed, 101 insertions(+), 1 deletion(-)

New commits:
commit 56e9bf6c459a0cbd8b373047d960cd4d68a526e4
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jan 21 15:25:03 2015 +

Resolves: fdo#87601 specific html doc hangs on load

Change-Id: I67f472d72efe123b533d4d94be0084986c0e8349
(cherry picked from commit 6acd5c45c764d81aea1539e66adbfadb51df0aa3)
Reviewed-on: https://gerrit.libreoffice.org/14081
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/core/data/html/pass/fdo87601-1.html 
b/sw/qa/core/data/html/pass/fdo87601-1.html
new file mode 100644
index 000..b33f11c
--- /dev/null
+++ b/sw/qa/core/data/html/pass/fdo87601-1.html
@@ -0,0 +1,100 @@
+
+   html xmlns:v=urn:schemas-microsoft-com:vml
+   xmlns:o=urn:schemas-microsoft-com:office:office
+   xmlns:w=urn:schemas-microsoft-com:office:word
+   
xmlns:m=http://schemas.microsoft.com/office/2006/01/omml;
+   xmlns=http://www.w3.org/TR/REC-html40;
+   head
+   meta http-equiv=Content-Type content=text/html; 
charset=utf-8
+   style
+   v\:* {behavior:url(#default#VML);}
+   o\:* {behavior:url(#default#VML);}
+   w\:* {behavior:url(#default#VML);}
+   .shape {behavior:url(#default#VML);}
+   /style
+   style
+   @page
+   {
+   mso-page-orientation: portrait;
+   size:21cm 29.7cm;margin:1cm 1cm 1cm 
1cm;
+   }
+   @page Section1 {
+   mso-header-margin:.5in;
+   mso-footer-margin:.5in;
+   mso-header: h1;
+   mso-footer: f1;
+   mso-bidi-font:Arial;
+   }
+   div.Section1 { page:Section1; }
+   table {
+   border-spacing: 0;
+   border-collapse: collapse;
+   font-size: 10.0pt;
+   }
+   td
+   {
+   border: 1px solid #000;
+   font-size:10.0pt;
+   font-family:Verdana,sans-serif;
+   margin-bottom:0.000cm;
+   vertical-align:top;
+   }
+   p.MsoFooter, li.MsoFooter, div.MsoFooter
+   {
+   margin:0in;
+   margin-bottom:.0001pt;
+   mso-pagination:widow-orphan;
+   tab-stops:center 3.0in right 6.0in;
+   font-size:10.0pt;
+   }
+   /style
+   xml
+   w:WordDocument
+   w:ViewPrint/w:View
+   w:Zoom100/w:Zoom
+   w:DoNotOptimizeForBrowsertc2ms/
+   /w:WordDocument
+   /xml
+   /head
+   body style=width:21.001cm;
+   div class=Section1
+   br
+   br
+   h1 
style=mso-element:header;font-size:24.0pt;font-weight:normal;font-family:Verdana,sans-serif;color:#f00;
 id=h1
+   p class=MsoHeader
+   Your bug here
+   /p
+   /h1
+   br
+   table width=700 cellpadding=6 
style=border-collapse:collapse;
+   tr
+   td width=200 border=1 
style=font-weight:bold;x/td
+   td width=500 style=font-weight:bold;x/td
+   /tr
+   tr
+   td style=font-weight:bold;x/td
+   td style=font-weight:bold;x/td
+   /tr
+   tr
+   td style=font-weight:bold;x/td
+

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2015-01-16 Thread Michael Stahl
 sw/qa/extras/ooxmlimport/data/rhbz1180114.docx|binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |5 +
 writerfilter/source/dmapper/DomainMapper.cxx  |6 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 ++-
 writerfilter/source/ooxml/model.xml   |   16 
 5 files changed, 29 insertions(+), 1 deletion(-)

New commits:
commit 7a728f882b5a66d2184dcc2fbcf291b9dbba88fe
Author: Michael Stahl mst...@redhat.com
Date:   Wed Jan 14 23:01:41 2015 +0100

rhbz#1180114: writerfilter: don't crash on w:customXmlDelRangeStart etc.

We can't do anything sensible with these CustomXML elements but now we
have to handle them because.

(regression from 9dbf817fe5c5253fba0831aefa17575ae0ba3af1)

Change-Id: If4247890ff9961a77434587802670d28608a7922
(cherry picked from commit f22964e0e622af1168e241f933e5cf98e093ec2b)
Reviewed-on: https://gerrit.libreoffice.org/13914
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/ooxmlimport/data/rhbz1180114.docx 
b/sw/qa/extras/ooxmlimport/data/rhbz1180114.docx
new file mode 100644
index 000..23009eb
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/rhbz1180114.docx 
differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 0082009..44876b9 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -728,6 +728,11 @@ DECLARE_OOXMLIMPORT_TEST(testN779834, n779834.docx)
 // This document simply crashed the importer.
 }
 
+DECLARE_OOXMLIMPORT_TEST(testRHBZ1180114, rhbz1180114.docx)
+{
+// This document simply crashed the importer.
+}
+
 DECLARE_OOXMLIMPORT_TEST(testN779627, n779627.docx)
 {
 /*
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 8bc3320..44efb59 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2164,6 +2164,12 @@ void DomainMapper::sprmWithProps( Sprm rSprm, 
PropertyMapPtr rContext )
 case NS_ooxml::LN_CT_PPr_pPrChange:
 case NS_ooxml::LN_trackchange:
 case NS_ooxml::LN_EG_RPrContent_rPrChange:
+case NS_ooxml::LN_EG_RangeMarkupElements_customXmlDelRangeStart:
+case NS_ooxml::LN_EG_RangeMarkupElements_customXmlDelRangeEnd:
+case NS_ooxml::LN_EG_RangeMarkupElements_customXmlMoveFromRangeStart:
+case NS_ooxml::LN_EG_RangeMarkupElements_customXmlMoveFromRangeEnd:
+case NS_ooxml::LN_EG_RangeMarkupElements_customXmlMoveToRangeStart:
+case NS_ooxml::LN_EG_RangeMarkupElements_customXmlMoveToRangeEnd:
 {
 HandleRedline( rSprm );
 }
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 3779aa3..e2eaeec 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4623,9 +4623,10 @@ void DomainMapper_Impl::SetCurrentRedlineId( sal_Int32 
sId )
 {
 // This should be an assert, but somebody had the smart idea to reuse 
this function also for comments and whatnot,
 // and in some cases the id is actually not handled, which may be in 
fact a bug.
-SAL_WARN( writerfilter, !m_currentRedline.get());
 if( m_currentRedline.get())
 m_currentRedline-m_nId = sId;
+else
+SAL_INFO(writerfilter.dmapper, no current redline);
 }
 }
 
diff --git a/writerfilter/source/ooxml/model.xml 
b/writerfilter/source/ooxml/model.xml
index 1e427b1..69ac296 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -24200,6 +24200,22 @@
 resource name=CT_TrackChange resource=Properties tag=redline
   attribute name=author tokenid=ooxml:CT_TrackChange_author/
   attribute name=date tokenid=ooxml:CT_TrackChange_date/
+  action name=end 
tokenid=ooxml:EG_RangeMarkupElements_customXmlInsRangeStart 
action=sendPropertiesWithId 
sendtokenid=ooxml:EG_RangeMarkupElements_customXmlInsRangeStart/
+  action name=end 
tokenid=ooxml:EG_RangeMarkupElements_customXmlInsRangeStart 
action=clearProps/
+  action name=end 
tokenid=ooxml:EG_RangeMarkupElements_customXmlInsRangeEnd 
action=sendPropertiesWithId 
sendtokenid=ooxml:EG_RangeMarkupElements_customXmlInsRangeEnd/
+  action name=end 
tokenid=ooxml:EG_RangeMarkupElements_customXmlInsRangeEnd 
action=clearProps/
+  action name=end 
tokenid=ooxml:EG_RangeMarkupElements_customXmlDelRangeStart 
action=sendPropertiesWithId 
sendtokenid=ooxml:EG_RangeMarkupElements_customXmlDelRangeStart/
+  action name=end 
tokenid=ooxml:EG_RangeMarkupElements_customXmlDelRangeStart 
action=clearProps/
+  action name=end 
tokenid=ooxml:EG_RangeMarkupElements_customXmlDelRangeEnd 
action=sendPropertiesWithId 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa

2015-01-14 Thread Christian Lohmaier
 sw/qa/extras/rtfimport/rtfimport.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3bfe5261592d7c5fbb0a20af0f3bdcac373d4f8a
Author: Christian Lohmaier lohmaier+libreoff...@googlemail.com
Date:   Wed Jan 14 11:54:10 2015 +0100

'' must be ' ' in nested templates pre c++11

foobarbaz must be 'foobarbaz ' with gcc44

Change-Id: I9ae7cf09d15673d4c1e0c2f21a1cfe569e384145
Reviewed-on: https://gerrit.libreoffice.org/13902
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index e2b9030..2cdbcbc 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2028,14 +2028,14 @@ DECLARE_RTFIMPORT_TEST(testFdo84685, fdo84685.rtf)
 {
 // index mark was not imported
 uno::Referencetext::XDocumentIndexMark xMark(
-getPropertyuno::Referencetext::XDocumentIndexMark(
+getPropertyuno::Referencetext::XDocumentIndexMark (
 getRun(getParagraph(1), 1),
 DocumentIndexMark));
 CPPUNIT_ASSERT(xMark.is());
 CPPUNIT_ASSERT_EQUAL(OUString(Key the 1st), getPropertyOUString(xMark, 
PrimaryKey));
 // let's test toc entry too
 uno::Referencetext::XDocumentIndexMark xTOCMark(
-getPropertyuno::Referencetext::XDocumentIndexMark(
+getPropertyuno::Referencetext::XDocumentIndexMark (
 getRun(getParagraph(2), 1),
 DocumentIndexMark));
 CPPUNIT_ASSERT(xTOCMark.is());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-12-18 Thread Miklos Vajna
 sw/qa/extras/ooxmlexport/data/multi-page-toc.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx  |   12 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   18 ++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |   18 ++
 4 files changed, 48 insertions(+)

New commits:
commit 99b3e159726b51537563790e8f73b43a88970e13
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Oct 7 17:53:29 2014 +0200

DOCX import: handle section break right after a ToC field

The symptom was that during the handling of the XE field, we tried to
access the top of the text append stack, but the stack was empty.

The situation is the following:

1) There is a multi-page TOC field.
2) The page break inside the field is described using a section break,
featuring headers, and the header contains a field that we map to a
fieldmark.
3) There is an XE field after all this.

The root cause was that during parsing of the header, some of the state
should be stashed away and restored when we're done. The new
HeaderFooterContext does exactly this, and now the number of push/pop
calls on the text append context match again.

(cherry picked from commit 153af84762f98d6c86c4c060b01402f40b2b0c24)

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

Change-Id: I10f259fd9edb8bd719ae5bc8a43ed5ef8c708071
Reviewed-on: https://gerrit.libreoffice.org/13524
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/ooxmlexport/data/multi-page-toc.docx 
b/sw/qa/extras/ooxmlexport/data/multi-page-toc.docx
new file mode 100644
index 000..5b5b594
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/multi-page-toc.docx 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 2fe437b..a443d58 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3706,6 +3706,18 @@ DECLARE_OOXMLEXPORT_TEST(testMsoPosition, 
bnc884615-mso-position.docx)
 }
 }
 
+DECLARE_OOXMLEXPORT_TEST(testMultiPageToc, multi-page-toc.docx)
+{
+// Import of this document triggered an STL assertion.
+
+// Document has a ToC from its second paragraph.
+uno::Referencecontainer::XNamed xTextSection = getProperty 
uno::Referencecontainer::XNamed (getParagraph(2), TextSection);
+CPPUNIT_ASSERT_EQUAL(OUString(Table of Contents1), 
xTextSection-getName());
+// There should be a field in the header as well.
+uno::Referencetext::XText xHeaderText = getProperty 
uno::Referencetext::XText 
(getStyles(PageStyles)-getByName(DEFAULT_STYLE), HeaderText);
+CPPUNIT_ASSERT_EQUAL(OUString(TextFieldStart), 
getPropertyOUString(getRun(getParagraphOfText(1, xHeaderText), 1), 
TextPortionType));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index bc4ff52..3779aa3 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1496,6 +1496,9 @@ uno::Reference beans::XPropertySet  
DomainMapper_Impl::appendTextSectionAfter(
 
 void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, 
SectionPropertyMap::PageType eType)
 {
+m_aHeaderFooterStack.push(HeaderFooterContext(m_bTextInserted));
+m_bTextInserted = false;
+
 const PropertyIds ePropIsOn = bHeader? PROP_HEADER_IS_ON: 
PROP_FOOTER_IS_ON;
 const PropertyIds ePropShared = bHeader? PROP_HEADER_IS_SHARED: 
PROP_FOOTER_IS_SHARED;
 const PropertyIds ePropTextLeft = bHeader? PROP_HEADER_TEXT_LEFT: 
PROP_FOOTER_TEXT_LEFT;
@@ -1576,6 +1579,12 @@ void DomainMapper_Impl::PopPageHeaderFooter()
 m_bDiscardHeaderFooter = false;
 }
 m_bInHeaderFooterImport = false;
+
+if (!m_aHeaderFooterStack.empty())
+{
+m_bTextInserted = m_aHeaderFooterStack.top().getTextInserted();
+m_aHeaderFooterStack.pop();
+}
 }
 
 
@@ -2523,6 +2532,15 @@ bool DomainMapper_Impl::IsOpenField() const
 return !m_aFieldStack.empty();
 }
 
+HeaderFooterContext::HeaderFooterContext(bool bTextInserted)
+: m_bTextInserted(bTextInserted)
+{
+}
+
+bool HeaderFooterContext::getTextInserted()
+{
+return m_bTextInserted;
+}
 
 FieldContext::FieldContext(uno::Reference text::XTextRange  xStart) :
 m_bFieldCommandCompleted( false )
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index f72c866..68e1af7 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -113,6 +113,22 @@ enum BreakType
 PAGE_BREAK,
 COLUMN_BREAK
 };
+
+/**
+ * Storage for state that is relevant outside a header/footer, but not inside 
it.
+ *
+ * In case some state of 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-12-18 Thread Michael Stahl
 sw/qa/extras/rtfimport/data/fdo84685.rtf   |7 ++
 sw/qa/extras/rtfimport/rtfimport.cxx   |   20 +++
 writerfilter/source/rtftok/rtfcontrolwords.hxx |2 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   26 +
 4 files changed, 55 insertions(+)

New commits:
commit d90c5fbf67dc76c18cf703267139e7ad6b26564b
Author: Michael Stahl mst...@redhat.com
Date:   Tue Dec 16 23:17:28 2014 +0100

fdo#84685: writerfilter: RTF import: support \xe index entry

(cherry picked from commit f14e6e06b9e3c82c267649d63512a3538e5ee2f5)

(related fdo#84685): writerfilter: RTF import: support \tc TOC entry

(cherry picked from commit 1dd1dfc152c7cbeb374fe4f38b08c6af9cef2c06)

fix Windows build
(cherry picked from commit acfd640fd8547d3275c5db714b88d52b3fe7c4d5)

Change-Id: Ia957541a5997961aa86b2eb8537ebd29d3092691
Reviewed-on: https://gerrit.libreoffice.org/13508
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/data/fdo84685.rtf 
b/sw/qa/extras/rtfimport/data/fdo84685.rtf
new file mode 100644
index 000..af73b1a
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo84685.rtf
@@ -0,0 +1,7 @@
+{\rtf1\ansi\ansicpg1252\uc1
+\pard
+{\v {\xe {\v {\f0\fs20 Key the 1st Some text
+\par
+{\v {\tc {\v {\f0\fs20 foo Some text
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 721fd73..e2b9030 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -30,6 +30,7 @@
 #include com/sun/star/text/SizeType.hpp
 #include com/sun/star/text/TableColumnSeparator.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
+#include com/sun/star/text/XDocumentIndexMark.hpp
 #include com/sun/star/text/XFootnotesSupplier.hpp
 #include com/sun/star/text/XPageCursor.hpp
 #include com/sun/star/text/XTextGraphicObjectsSupplier.hpp
@@ -2023,6 +2024,25 @@ DECLARE_RTFIMPORT_TEST(testUnbalancedColumns, 
unbalanced-columns.rtf)
 CPPUNIT_ASSERT_EQUAL(true, getPropertybool(xTextSections-getByIndex(0), 
DontBalanceTextColumns));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo84685, fdo84685.rtf)
+{
+// index mark was not imported
+uno::Referencetext::XDocumentIndexMark xMark(
+getPropertyuno::Referencetext::XDocumentIndexMark(
+getRun(getParagraph(1), 1),
+DocumentIndexMark));
+CPPUNIT_ASSERT(xMark.is());
+CPPUNIT_ASSERT_EQUAL(OUString(Key the 1st), getPropertyOUString(xMark, 
PrimaryKey));
+// let's test toc entry too
+uno::Referencetext::XDocumentIndexMark xTOCMark(
+getPropertyuno::Referencetext::XDocumentIndexMark(
+getRun(getParagraph(2), 1),
+DocumentIndexMark));
+CPPUNIT_ASSERT(xTOCMark.is());
+uno::Referencelang::XServiceInfo xTOCSI(xTOCMark, uno::UNO_QUERY);
+
CPPUNIT_ASSERT(xTOCSI-supportsService(com.sun.star.text.ContentIndexMark));
+}
+
 DECLARE_RTFIMPORT_TEST(testFdo83204, fdo83204.rtf)
 {
 // This was Standard, \sN was ignored after \bkmkstart and \pard.
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx 
b/writerfilter/source/rtftok/rtfcontrolwords.hxx
index f89e4cf..8f56e88 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.hxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx
@@ -148,6 +148,8 @@ enum RTFDestinationState
 DESTINATION_BACKGROUND,
 DESTINATION_SHAPEGROUP,
 DESTINATION_FOOTNOTESEPARATOR,
+DESTINATION_INDEXENTRY,
+DESTINATION_TOCENTRY,
 };
 
 enum RTFKeyword
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b61f5a7..447493c 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1248,6 +1248,8 @@ void RTFDocumentImpl::text(OUString rString)
 case DESTINATION_MSUPHIDE:
 case DESTINATION_MTYPE:
 case DESTINATION_MGROW:
+case DESTINATION_INDEXENTRY:
+case DESTINATION_TOCENTRY:
 m_aStates.top().pDestinationText-append(rString);
 break;
 default:
@@ -1716,6 +1718,13 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 case RTF_BKMKEND:
 m_aStates.top().nDestinationState = DESTINATION_BOOKMARKEND;
 break;
+case RTF_XE:
+m_aStates.top().nDestinationState = DESTINATION_INDEXENTRY;
+break;
+case RTF_TC:
+case RTF_TCN:
+m_aStates.top().nDestinationState = DESTINATION_TOCENTRY;
+break;
 case RTF_REVTBL:
 m_aStates.top().nDestinationState = DESTINATION_REVISIONTABLE;
 break;
@@ -5047,6 +5056,23 @@ int RTFDocumentImpl::popState()
 break; // not for nested group
 
Mapper().props(lcl_getBookmarkProperties(m_aBookmarks[m_aStates.top().pDestinationText-makeStringAndClear()]));
 break;
+case 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-12-15 Thread Miklos Vajna
 sw/qa/extras/htmlexport/htmlexport.cxx|4 +-
 sw/qa/extras/rtfimport/data/fdo85179.rtf  |4 ++
 sw/qa/extras/rtfimport/data/fdo86761.rtf  |   42 ++
 sw/qa/extras/rtfimport/rtfimport.cxx  |6 +++
 writerfilter/source/dmapper/GraphicImport.cxx |3 +
 writerfilter/source/rtftok/rtfsdrimport.cxx   |2 +
 6 files changed, 58 insertions(+), 3 deletions(-)

New commits:
commit cfb770dc619fc33796b98ca900eb3fd7f714139e
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Dec 14 11:13:17 2014 +0100

fdo#86761 RTF import: positive border width and fLine=0 means no border

Regression from 01a32b7d074511bed24044dc94e1159aea62722b (fdo#85179 RTF
filter: import image border, 2014-10-23), there were a number of
problems here:

- CppunitTest_sw_htmlexport: revert back to the old behavior, where in
  case there is no border, we don't set the color of it.
- The testcase of the above commit omitted fLine=1 shape property, which
  is present in the original bugdoc, and only with that should we put a
  border around the shape.
- Let fLine=1 explicitly change the line style from NONE.
- dmapper: if line style is NONE, then don't bother setting the border
  color and width.

(cherry picked from commit 4568d1d298bf4fc98dcd86384743a04587a2fe6f)

Conflicts:
writerfilter/source/dmapper/GraphicImport.cxx

Change-Id: Iffee41066d42822b699c478821645b9742df3f58
Reviewed-on: https://gerrit.libreoffice.org/13470
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 15834fe..a377195 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -122,7 +122,7 @@ DECLARE_HTMLEXPORT_TEST(testExportOfImages, 
textAndImage.docx)
 CPPUNIT_ASSERT(pDoc);
 
 assertXPath(pDoc, /html/body, 1);
-assertXPath(pDoc, /html/body/p/font/img, 1);
+assertXPath(pDoc, /html/body/p/img, 1);
 }
 
 DECLARE_HTMLEXPORT_TEST(testExportOfImagesWithSkipImageEnabled, 
textAndImage.docx)
@@ -131,7 +131,7 @@ 
DECLARE_HTMLEXPORT_TEST(testExportOfImagesWithSkipImageEnabled, textAndImage.do
 CPPUNIT_ASSERT(pDoc);
 
 assertXPath(pDoc, /html/body, 1);
-assertXPath(pDoc, /html/body/p/font/img, 0);
+assertXPath(pDoc, /html/body/p/img, 0);
 }
 
 DECLARE_HTMLEXPORT_TEST(testSkipImageEmbedded, skipimage-embedded.doc)
diff --git a/sw/qa/extras/rtfimport/data/fdo85179.rtf 
b/sw/qa/extras/rtfimport/data/fdo85179.rtf
index fb9bcfa..8c69d31 100644
--- a/sw/qa/extras/rtfimport/data/fdo85179.rtf
+++ b/sw/qa/extras/rtfimport/data/fdo85179.rtf
@@ -15,6 +15,10 @@
 {\sn lineWidth}
 {\sv 50800}
 }
+{\sp
+{\sn fLine}
+{\sv 1}
+}
 }
 
\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw1806\pich1806\picwgoal1024\pichgoal1024\pngblip
 
89504e470d0a1a0a000d4948445200400040080460b955000467414d41b18f0bfc610500017352474200aece1ce9
diff --git a/sw/qa/extras/rtfimport/data/fdo86761.rtf 
b/sw/qa/extras/rtfimport/data/fdo86761.rtf
new file mode 100644
index 000..f22d836
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo86761.rtf
@@ -0,0 +1,42 @@
+{\rtf1
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid3346813 
\hich\af31506\dbch\af31505\loch\f31506 Image with no border
+\par }
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 
\lang1024\langfe1024\noproof\insrsid986338\charrsid3761114
+{\*\shppict
+{\pict
+{\*\picprop\shplid1026
+{\sp
+{\sn shapeType}
+{\sv 75}
+}
+{\sp
+{\sn fLockAgainstSelect}
+{\sv 0}
+}
+{\sp
+{\sn fLine}
+{\sv 0}
+}
+{\sp
+{\sn wzName}
+{\sv Picture 1}
+}
+}
+\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0
+\picw3598\pich4233\picwgoal2040\pichgoal2400\jpegblip\bliptag-859510685
+{\*\blipuid ccc4e863fe2f64c0500a0ae3f1b81a42}
+89504e470d0a1a0a000d4948445200400040080460b955000467414d41b18f0bfc610500017352474200aece1ce9
+00206348524d7a268084fa0080e87530ea603a9817709cba513c0002624b4744aa8d233200096f464673
+0006000c7355d30009704859730dd70dd70142289b78000976704167004c0040009d31381b01cd4944415468
+deedd93d4fc24018c0f17f89c6cdc44940e3e222be2c0e7e0417e3a8113571707632514012a320c6f84d34be2c2ec2b750f40be8e6e4a00113cfe14a5b69b108
+f4589ee71652eefafce0b9f42e3d7063822aaac3f641d173a75d3efee85b6582c0c8749c5eb7332cfb4e6f213d336ed29807304477b1c7a94db80ae9e9c934d0
+fcdd12e7ffcefcc9168f9a0059143b8cb0d2de581f609854073fbecc220f60b18722479d0d14abed8c8cb5d3293ce2949903b0d8a7047cb1c98541008cba840c
+a736e1d2200046b967567f740961d3b197008873cf74835002eaac736319ca0d4296121675d2dc1a0440d2256428625163ed2f42cf011e8245d621b42c44
+0400485261a699706d192fa100d4490713220240dc25e438b1090185880ca09f8ece5c28d9843b009e82471ca25069d5cb785529bd007fdbfb8541b65b2f

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-12-08 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo86750.rtf  |4 
 sw/qa/extras/rtfimport/rtfimport.cxx  |6 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |9 +
 3 files changed, 19 insertions(+)

New commits:
commit 3a2a74a48405d6d3423c06f9752c2254684d7770
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Dec 8 09:16:22 2014 +0100

fdo#86750 RTF import: fix table of contents links

(cherry picked from commit 4517c94000153eab6c034ea548698953dd93f794)

Change-Id: I0f3d35a0e64c9ce5646fa63eda317bee42de5540
Reviewed-on: https://gerrit.libreoffice.org/13372
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo86750.rtf 
b/sw/qa/extras/rtfimport/data/fdo86750.rtf
new file mode 100644
index 000..29f0b84
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo86750.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+{\field{\*\fldinst { HYPERLINK \\l anchor }}{\fldrslt click}}\par
+{\*\bkmkstart anchor}target{\*\bkmkend anchor}\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index e3fddac..416b01a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2054,6 +2054,12 @@ DECLARE_RTFIMPORT_TEST(testFdo72031, fdo72031.rtf)
 CPPUNIT_ASSERT_EQUAL(aExpected, getRun(getParagraph(1), 1)-getString());
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo86750, fdo86750.rtf)
+{
+// This was 'HYPERLINK#anchor', the URL of the hyperlink had the field 
type as a prefix, leading to broken links.
+CPPUNIT_ASSERT_EQUAL(OUString(#anchor), 
getPropertyOUString(getRun(getParagraph(1), 1), HyperLinkURL));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index c3343f1..1654744 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3577,6 +3577,15 @@ void DomainMapper_Impl::CloseFieldCommand()
 case FIELD_HYPERLINK:
 {
 ::std::vectorOUString aParts = 
pContext-GetCommandParts();
+
+// Syntax is either:
+// HYPERLINK  \l link
+// or
+// HYPERLINK \l link
+// Make sure HYPERLINK doesn't end up as part of 
link in the second case.
+if (!aParts.empty()  aParts[0] == HYPERLINK)
+aParts.erase(aParts.begin());
+
 ::std::vectorOUString::const_iterator aItEnd = 
aParts.end();
 ::std::vectorOUString::const_iterator aPartIt = 
aParts.begin();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-11-24 Thread Andras Timar
 sw/qa/extras/rtfimport/data/fdo85889-mac.rtf   |3 ++
 sw/qa/extras/rtfimport/data/fdo85889-pc.rtf|3 ++
 sw/qa/extras/rtfimport/data/fdo85889-pca.rtf   |3 ++
 sw/qa/extras/rtfimport/rtfimport.cxx   |   26 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   12 +++
 5 files changed, 47 insertions(+)

New commits:
commit d74f3f2a1b98fbcba9e5490b6d790fa40d8b863d
Author: Andras Timar andras.ti...@collabora.com
Date:   Mon Nov 24 11:33:17 2014 +0100

fdo#85889 handle pc, pca and mac rtf keywords in writerfilter

(cherry picked from commit 7839633fb356285652ed96f4bf3f85bcd5b561a4)

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

Change-Id: Ic54f2233a37562bdc516e440af0b4b7973f56342
Reviewed-on: https://gerrit.libreoffice.org/13106
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/data/fdo85889-mac.rtf 
b/sw/qa/extras/rtfimport/data/fdo85889-mac.rtf
new file mode 100644
index 000..8056d47
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo85889-mac.rtf
@@ -0,0 +1,3 @@
+{\rtf1\mac \deff0{\fonttbl{\f0\fmodern Helvetica;}}
+\pard\f0\fs20 \'f1\'f2\'f3\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo85889-pc.rtf 
b/sw/qa/extras/rtfimport/data/fdo85889-pc.rtf
new file mode 100644
index 000..a3b9d27
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo85889-pc.rtf
@@ -0,0 +1,3 @@
+{\rtf1\pc \deff0{\fonttbl{\f0\fmodern Helvetica;}}
+\pard\f0\fs20 \'f1\'f2\'f3\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo85889-pca.rtf 
b/sw/qa/extras/rtfimport/data/fdo85889-pca.rtf
new file mode 100644
index 000..34eeb18
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo85889-pca.rtf
@@ -0,0 +1,3 @@
+{\rtf1\pca \deff0{\fonttbl{\f0\fmodern Helvetica;}}
+\pard\f0\fs20 \'f1\'f2\'f3\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 9a274fd..bf4b176 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2023,6 +2023,32 @@ DECLARE_RTFIMPORT_TEST(testFdo83204, fdo83204.rtf)
 CPPUNIT_ASSERT_EQUAL(OUString(Heading 1), 
getPropertyOUString(getParagraph(1), ParaStyleName));
 }
 
+
+DECLARE_RTFIMPORT_TEST(testFdo85889pc, fdo85889-pc.rtf)
+{
+uno::Referencetext::XTextRange xTextRange = getRun(getParagraph(1), 1);
+
+OUString aExpected(\xc2\xb1\xe2\x89\xa5\xe2\x89\xa4, 8, 
RTL_TEXTENCODING_UTF8);
+CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange-getString());
+}
+
+DECLARE_RTFIMPORT_TEST(testFdo85889pca, fdo85889-pca.rtf)
+{
+uno::Referencetext::XTextRange xTextRange = getRun(getParagraph(1), 1);
+
+OUString aExpected(\xc2\xb1\xe2\x80\x97\xc2\xbe, 7, 
RTL_TEXTENCODING_UTF8);
+CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange-getString());
+}
+
+DECLARE_RTFIMPORT_TEST(testFdo85889mac, fdo85889-mac.rtf)
+{
+uno::Referencetext::XTextRange xTextRange = getRun(getParagraph(1), 1);
+
+OUString aExpected(\xc3\x92\xc3\x9a\xc3\x9b, 6, RTL_TEXTENCODING_UTF8);
+CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange-getString());
+}
+
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index a8d88f3..27e0ab2 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2830,6 +2830,18 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 case RTF_ANSI:
 m_aStates.top().nCurrentEncoding = RTL_TEXTENCODING_MS_1252;
 break;
+case RTF_MAC:
+m_nCurrentEncoding = RTL_TEXTENCODING_APPLE_ROMAN;
+m_aStates.top().nCurrentEncoding = m_nCurrentEncoding;
+break;
+case RTF_PC:
+m_nCurrentEncoding = RTL_TEXTENCODING_IBM_437;
+m_aStates.top().nCurrentEncoding = m_nCurrentEncoding;
+break;
+case RTF_PCA:
+m_nCurrentEncoding = RTL_TEXTENCODING_IBM_850;
+m_aStates.top().nCurrentEncoding = m_nCurrentEncoding;
+break;
 case RTF_PLAIN:
 {
 m_aStates.top().aCharacterSprms = getDefaultState().aCharacterSprms;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-11-23 Thread Miklos Vajna
 sw/qa/extras/rtfexport/data/fdo82006.rtf   |4 
 sw/qa/extras/rtfexport/rtfexport.cxx   |7 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |8 
 3 files changed, 19 insertions(+)

New commits:
commit 1a7de2e1f14bd4be68d1ccee24249427fa98781a
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Nov 22 20:08:42 2014 +0100

fdo#82006 RTF filter: import \sbauto and \saauto

(cherry picked from commit bb77fd64f9219f1b8f990f5041d81cfddd021213)

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

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

diff --git a/sw/qa/extras/rtfexport/data/fdo82006.rtf 
b/sw/qa/extras/rtfexport/data/fdo82006.rtf
new file mode 100644
index 000..0f5ee43
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo82006.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\pard\plain
+\ql \sb100\sa100\sbauto1\saauto1 hello\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index 0bcf1a8..83b9aba 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -665,6 +665,13 @@ DECLARE_RTFEXPORT_TEST(testFdo82858, fdo82858.docx)
 CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::NONE, 
getPropertytable::BorderLine2(getShape(1), TopBorder).LineStyle);
 }
 
+DECLARE_RTFEXPORT_TEST(testFdo82006, fdo82006.rtf)
+{
+// These were 176 (100 twips), as \sbauto and \sbbefore were ignored.
+CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), 
getPropertysal_Int32(getParagraph(0), ParaTopMargin));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), 
getPropertysal_Int32(getParagraph(0), ParaBottomMargin));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 7c5cbf1..a8d88f3 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4757,6 +4757,14 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, 
bool bParam, int nParam
NS_ooxml::LN_trackchange, NS_ooxml::LN_token, 
pValue);
 }
 break;
+case RTF_SBAUTO:
+lcl_putNestedAttribute(m_aStates.top().aParagraphSprms,
+   NS_ooxml::LN_CT_PPrBase_spacing, 
NS_ooxml::LN_CT_Spacing_beforeAutospacing, pBoolValue, OVERWRITE_YES);
+break;
+case RTF_SAAUTO:
+lcl_putNestedAttribute(m_aStates.top().aParagraphSprms,
+   NS_ooxml::LN_CT_PPrBase_spacing, 
NS_ooxml::LN_CT_Spacing_afterAutospacing, pBoolValue, OVERWRITE_YES);
+break;
 default:
 {
 SAL_INFO(writerfilter, TODO handle toggle '  
lcl_RtfToString(nKeyword)  ');
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-11-20 Thread Miklos Vajna
 sw/qa/extras/uiwriter/data/commented-word.odt |binary
 sw/qa/extras/uiwriter/uiwriter.cxx|   15 +++
 sw/source/core/unocore/unofield.cxx   |   14 ++
 3 files changed, 29 insertions(+)

New commits:
commit dd28346b4f9bd116616cd4e574f74aa5745aca60
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Nov 18 09:05:12 2014 +0100

fdo#86131 SwXTextField::getAnchor: handle postit field with annotation mark

(cherry picked from commit 2608512056b706bab57e36765e15f5c00668577a)

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

Change-Id: I3881c4577375a2eda053f64800d0991de6f009ad
Reviewed-on: https://gerrit.libreoffice.org/12979
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/uiwriter/data/commented-word.odt 
b/sw/qa/extras/uiwriter/data/commented-word.odt
new file mode 100644
index 000..ab423fa
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/commented-word.odt 
differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 6ec70b6..53f967a 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -37,6 +37,7 @@ public:
 void testFdo75898();
 void testFdo74981();
 void testCp171();
+void testCommentedWord();
 
 CPPUNIT_TEST_SUITE(SwUiWriterTest);
 CPPUNIT_TEST(testReplaceForward);
@@ -49,6 +50,7 @@ public:
 CPPUNIT_TEST(testFdo75898);
 CPPUNIT_TEST(testFdo74981);
 CPPUNIT_TEST(testCp171);
+CPPUNIT_TEST(testCommentedWord);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -306,6 +308,19 @@ void SwUiWriterTest::testCp171()
 CPPUNIT_ASSERT_EQUAL( redlineEnd1Index, rTbl[ 1 
]-End()-nContent.GetIndex());
 }
 
+void SwUiWriterTest::testCommentedWord()
+{
+// This word is commented. - string in document
+createDoc(commented-word.odt);
+
+// Test that getAnchor() points to word, not to an empty string.
+uno::Referencetext::XTextFieldsSupplier xTextFieldsSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xFieldsAccess(xTextFieldsSupplier-getTextFields());
+uno::Referencecontainer::XEnumeration 
xFields(xFieldsAccess-createEnumeration());
+uno::Referencetext::XTextContent xField(xFields-nextElement(), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString(word), xField-getAnchor()-getString());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index 56be0c0..f409712 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2036,6 +2036,20 @@ SwXTextField::getAnchor() throw (uno::RuntimeException, 
std::exception)
 if (pPamForTxtFld.get() == NULL)
 return 0;
 
+// If this is a postit field, then return the range of its annotation mark 
if it has one.
+if (const SwPostItField* pPostItField = dynamic_castconst 
SwPostItField*(pField))
+{
+IDocumentMarkAccess* pMarkAccess = 
m_pImpl-m_pDoc-getIDocumentMarkAccess();
+for (IDocumentMarkAccess::const_iterator_t ppMark = 
pMarkAccess-getAnnotationMarksBegin(); ppMark != 
pMarkAccess-getAnnotationMarksEnd(); ++ppMark)
+{
+if (ppMark-get()-GetName() == pPostItField-GetName())
+{
+pPamForTxtFld.reset(new SwPaM(ppMark-get()-GetMarkStart(), 
ppMark-get()-GetMarkEnd()));
+break;
+}
+}
+}
+
 uno::Referencetext::XTextRange xRange = SwXTextRange::CreateXTextRange(
 *m_pImpl-m_pDoc, *(pPamForTxtFld-GetPoint()), 
pPamForTxtFld-GetMark());
 return xRange;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-11-18 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo83204.rtf   |9 +
 sw/qa/extras/rtfimport/rtfimport.cxx   |6 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 ++
 3 files changed, 17 insertions(+)

New commits:
commit 741be800ff7c6e6979c8b816ac2ceb955e7c303d
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Nov 16 12:12:43 2014 +0100

fdo#83204 RTF import: handle \pardpara props after \bkmkstart

(cherry picked from commit 8a30ba573470d59dbb0501b488f8a655b015ffd2)

Change-Id: I4f5f0f653f2ce7782ec1d1fc5ef550a21a9c1d35
Reviewed-on: https://gerrit.libreoffice.org/12527
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo83204.rtf 
b/sw/qa/extras/rtfimport/data/fdo83204.rtf
new file mode 100644
index 000..39d89b0
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo83204.rtf
@@ -0,0 +1,9 @@
+{\rtf1
+{\stylesheet
+{Normal;}
+{\s1 heading 1;}
+}
+{\*\bkmkstart titlebookmark}
+\pard\s1 Title\par
+{\*\bkmkend titlebookmark}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 8a6c6da..9a274fd 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2017,6 +2017,12 @@ DECLARE_RTFIMPORT_TEST(testUnbalancedColumns, 
unbalanced-columns.rtf)
 CPPUNIT_ASSERT_EQUAL(true, getPropertybool(xTextSections-getByIndex(0), 
DontBalanceTextColumns));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo83204, fdo83204.rtf)
+{
+// This was Standard, \sN was ignored after \bkmkstart and \pard.
+CPPUNIT_ASSERT_EQUAL(OUString(Heading 1), 
getPropertyOUString(getParagraph(1), ParaStyleName));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b372d34..31ff8b8 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2873,6 +2873,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 m_aStates.top().nCurrentStyleIndex = -1;
 }
 }
+// Need to send paragraph properties again, if there will be any.
+m_bNeedPap = true;
 break;
 case RTF_SECTD:
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/inc writerfilter/source

2014-11-17 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |8 
 sw/qa/extras/rtfimport/data/unbalanced-columns.rtf|5 +
 sw/qa/extras/rtfimport/rtfimport.cxx  |8 
 writerfilter/inc/dmapper/DomainMapper.hxx |1 +
 writerfilter/inc/resourcemodel/WW8ResourceModel.hxx   |3 +++
 writerfilter/source/dmapper/DomainMapper.cxx  |5 +
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 ++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |3 +++
 writerfilter/source/dmapper/PropertyMap.cxx   |9 ++---
 writerfilter/source/dmapper/PropertyMap.hxx   |2 +-
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |5 +
 writerfilter/source/ooxml/OOXMLFastContextHandler.hxx |1 +
 writerfilter/source/ooxml/model.xml   |1 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|6 ++
 15 files changed, 59 insertions(+), 4 deletions(-)

New commits:
commit 084d5986823e7bd7baaa68450c0a6b4772c84246
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Jul 17 14:59:19 2014 +0200

fdo#84645 RTF import: set DontBalanceTextColumns=true for the last section 
...

... if it has multiple columns. See commit
d185204737031955c56a24356ed003d342548434 (DOCX import: set
DontBalanceTextColumns=true for the last section, 2014-07-17) for the
DOCX equivalent of this problem; this just adapts the RTF tokenizer to
dmapper.

(cherry picked from commit d185204737031955c56a24356ed003d342548434)
(cherry picked from commit f4bb73164a51ec83fe1d5975b1232d35f8a9e88a)

Change-Id: Ib30f9b386e204b8b2987832ab17ee0cc53b3f0bc
Reviewed-on: https://gerrit.libreoffice.org/12462
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx 
b/sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx
new file mode 100755
index 000..da6f93f
Binary files /dev/null and 
b/sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 900a25e..0082009 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2395,6 +2395,14 @@ DECLARE_OOXMLIMPORT_TEST(testBnc821804, bnc821804.docx)
 CPPUNIT_ASSERT_EQUAL(false,getPropertybool(getRun(getParagraph(10), 3), 
IsStart));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testUnbalancedColumns, unbalanced-columns.docx)
+{
+uno::Referencetext::XTextSectionsSupplier 
xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xTextSections(xTextSectionsSupplier-getTextSections(), uno::UNO_QUERY);
+// This was false, last section was balanced, but it's unbalanced in Word.
+CPPUNIT_ASSERT_EQUAL(true, getPropertybool(xTextSections-getByIndex(2), 
DontBalanceTextColumns));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/rtfimport/data/unbalanced-columns.rtf 
b/sw/qa/extras/rtfimport/data/unbalanced-columns.rtf
new file mode 100644
index 000..aa57e38
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/unbalanced-columns.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+\cols2
+\pard\plain First paragraph.\par
+Second paragraph.\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 1214051..8a6c6da 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2009,6 +2009,14 @@ DECLARE_RTFIMPORT_TEST(testFdo82512, fdo82512.rtf)
 CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, 
getPropertystyle::BreakType(getParagraph(2), BreakType));
 }
 
+DECLARE_RTFIMPORT_TEST(testUnbalancedColumns, unbalanced-columns.rtf)
+{
+uno::Referencetext::XTextSectionsSupplier 
xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xTextSections(xTextSectionsSupplier-getTextSections(), uno::UNO_QUERY);
+// This was false, last section was balanced, but it's unbalanced in Word.
+CPPUNIT_ASSERT_EQUAL(true, getPropertybool(xTextSections-getByIndex(0), 
DontBalanceTextColumns));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx 
b/writerfilter/inc/dmapper/DomainMapper.hxx
index 9266f08..7143219 100644
--- a/writerfilter/inc/dmapper/DomainMapper.hxx
+++ b/writerfilter/inc/dmapper/DomainMapper.hxx
@@ -87,6 +87,7 @@ public:
 
 // Stream
 virtual void markLastParagraphInSection() SAL_OVERRIDE;
+virtual void markLastSectionGroup() SAL_OVERRIDE;
 
 // BinaryObj
 virtual void data(const sal_uInt8* buf, size_t len,
diff --git a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx 
b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
index 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-11-11 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo82512.rtf |   10 ++
 sw/qa/extras/rtfimport/rtfimport.cxx |6 ++
 writerfilter/source/dmapper/DomainMapper.cxx |8 
 3 files changed, 24 insertions(+)

New commits:
commit 7b0f4f9e9a9183c870424d68e5fb7aead6aaa96f
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Nov 1 22:00:46 2014 +0100

fdo#82512 RTF import: fix position of column break

(cherry picked from commit dcb37dcebcde6188eb58ef7d8d34d08fea4badb8)

Change-Id: Ib0f39c4af7cc32d0f4491f13ea207d90a449a47d
Reviewed-on: https://gerrit.libreoffice.org/12309
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo82512.rtf 
b/sw/qa/extras/rtfimport/data/fdo82512.rtf
new file mode 100644
index 000..925cc4b
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo82512.rtf
@@ -0,0 +1,10 @@
+{\rtf1\ansi\deff0
+\cols2\colsx709
+\pard\plain
+{First col\par}{
+\column
+\par
+\par
+Second col\par
+}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 93e1904..1214051 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2003,6 +2003,12 @@ DECLARE_RTFIMPORT_TEST(testFdo82076, fdo82076.rtf)
 CPPUNIT_ASSERT_EQUAL(OUString(Footnote), 
getPropertyOUString(getRun(getParagraphOfText(1, xCell-getText()), 2), 
TextPortionType));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo82512, fdo82512.rtf)
+{
+// This was style::BreakType_NONE, column break was before the 3rd 
paragraph, not before the 2nd one.
+CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, 
getPropertystyle::BreakType(getParagraph(2), BreakType));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 90ae6e9..7c8ac20 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2683,8 +2683,16 @@ void DomainMapper::lcl_text(const sal_uInt8 * data_, 
size_t len)
 case 0x07:
 m_pImpl-getTableManager().text(data_, len);
 case 0x0d:
+{
+PropertyMapPtr pContext = 
m_pImpl-GetTopContextOfType(CONTEXT_PARAGRAPH);
+if (pContext  m_pImpl-isBreakDeferred(COLUMN_BREAK))
+{
+pContext-Insert(PROP_BREAK_TYPE, 
uno::makeAny(style::BreakType_COLUMN_BEFORE));
+m_pImpl-clearDeferredBreak(COLUMN_BREAK);
+}
 
m_pImpl-finishParagraph(m_pImpl-GetTopContextOfType(CONTEXT_PARAGRAPH));
 return;
+}
 case 0x13:
 m_pImpl-PushFieldContext();
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-11-06 Thread Miklos Vajna
 sw/qa/extras/ww8export/data/bnc636128.doc |binary
 sw/qa/extras/ww8export/ww8export.cxx  |   10 ++
 sw/source/filter/ww8/wrtww8.cxx   |   10 ++
 sw/source/filter/ww8/ww8par.hxx   |4 +++-
 sw/source/filter/ww8/ww8par3.cxx  |5 +++--
 5 files changed, 26 insertions(+), 3 deletions(-)

New commits:
commit 82c01116a7df315b78bfd3af6ccd936572b45d78
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Nov 4 12:37:45 2014 +0100

bnc#636128 DOC filter: fix handling of FFData.cch

(cherry picked from commit dfa26e6d489a2c5bd79652450a9f27343008d37f)
(cherry picked from commit 2ad1f195b875f2c1052c8ffab79602b9f6871ccb)

Change-Id: Ia1a3a4ef5e61d8ed2a3bde689f3d2101525efc46
Reviewed-on: https://gerrit.libreoffice.org/12257
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/ww8export/data/bnc636128.doc 
b/sw/qa/extras/ww8export/data/bnc636128.doc
new file mode 100644
index 000..5f92c3e
Binary files /dev/null and b/sw/qa/extras/ww8export/data/bnc636128.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx 
b/sw/qa/extras/ww8export/ww8export.cxx
index 5857559..3a9cf7c 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -18,6 +18,7 @@
 #include com/sun/star/table/ShadowFormat.hpp
 #include com/sun/star/table/TableBorder2.hpp
 #include com/sun/star/text/GraphicCrop.hpp
+#include com/sun/star/text/XFormField.hpp
 
 class Test : public SwModelTestBase
 {
@@ -347,6 +348,15 @@ DECLARE_WW8EXPORT_TEST(testBorderColoursExport, 
bordercolours.odt)
 }
 #endif
 
+DECLARE_WW8EXPORT_TEST(testBnc636128, bnc636128.doc)
+{
+// Import / export of FFData.cch was missing.
+uno::Referencetext::XFormField xFormField = getProperty 
uno::Referencetext::XFormField (getRun(getParagraph(1), 2), Bookmark);
+uno::Referencecontainer::XNameContainer xParameters = 
xFormField-getParameters();
+// This resulted in a container.NoSuchElementException.
+CPPUNIT_ASSERT_EQUAL(OUString(5), 
xParameters-getByName(MaxLength).getOUString());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index f52a273..5917aa6 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3782,6 +3782,16 @@ void WW8Export::WriteFormData( const 
::sw::mark::IFieldmark rFieldmark )
 ffres = 0;
 }
 aFldHeader.bits |= ( (ffres2)  0x7C );
+if (type == 0) // iTypeText
+{
+sw::mark::IFieldmark::parameter_map_t::const_iterator pParameter = 
rFieldmark.GetParameters()-find(MaxLength);
+if (pParameter != rFieldmark.GetParameters()-end())
+{
+OUString aLength;
+pParameter-second = aLength;
+aFldHeader.cch = aLength.toUInt32();
+}
+}
 
 std::vector OUString  aListItems;
 if (type==2)
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index cbacc1f..a50724d0 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -617,7 +617,7 @@ public:
 WW8FormulaControl(const OUString rN, SwWW8ImplReader rR)
 : rRdr(rR), fUnknown(0), fDropdownIndex(0),
 fToolTip(0), fNoMark(0), fUseSize(0), fNumbersOnly(0), fDateOnly(0),
-fUnused(0), nSize(0), hpsCheckBox(20), nChecked(0), sName( rN )
+fUnused(0), nSize(0), hpsCheckBox(20), nChecked(0), mnMaxLen(0), 
sName( rN )
 {
 }
 sal_uInt8 fUnknown:2;
@@ -633,6 +633,8 @@ public:
 sal_uInt16 hpsCheckBox;
 sal_uInt16 nChecked;
 
+/// FFData.cch in the spec: maximum length, in characters, of the value of 
the textbox.
+sal_uInt16 mnMaxLen;
 OUString sTitle;
 OUString sDefault;
 OUString sFormatting;
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index b547cd0..5e10c8d0 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -164,6 +164,8 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* 
pF, OUString rStr )
 maFieldStack.back().SetBookmarkType(ODF_FORMTEXT);
 maFieldStack.back().getParameters()[Description] = 
uno::makeAny(OUString(aFormula.sToolTip));
 maFieldStack.back().getParameters()[Name] = 
uno::makeAny(OUString(aFormula.sTitle));
+if (aFormula.mnMaxLen)
+maFieldStack.back().getParameters()[MaxLength] = 
uno::makeAny(OUString::number(aFormula.mnMaxLen));
 }
 return FLD_TEXT;
 }
@@ -2173,8 +2175,7 @@ void WW8FormulaControl::FormulaRead(SwWw8ControlType 
nWhich,
 
 sal_uInt8 iRes = (bits1  0x7C)  2;
 
-sal_uInt16 cch = 0;
-pDataStream-ReadUInt16( cch );
+pDataStream-ReadUInt16( mnMaxLen );
 
 sal_uInt16 hps = 0;
 pDataStream-ReadUInt16( hps );

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-11-06 Thread Michael Stahl
 sw/qa/extras/rtfimport/data/fdo85812.rtf   |   39 +
 sw/qa/extras/rtfimport/rtfimport.cxx   |   72 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |3 +
 3 files changed, 114 insertions(+)

New commits:
commit f6ca0bb117fd31a61f2eac06187c0f41ba95a768
Author: Michael Stahl mst...@redhat.com
Date:   Tue Nov 4 22:45:48 2014 +0100

fdo#85812: RTF import: fix run type in new groups

Apparently the run type resets to LTR in a new group.

(regression from fc49c052dbdbb5ab3b0a02a13143705f769b9662)

(cherry picked from commit 88d3f9e4cf64e4ef037063b26ddf347fd42d8d84)

fdo#85812: RTF import: better fix for run type in new groups

Apparently Word treats \ltrch \rtlch differently from
\loch \hich \dbch when groups are opened.

Change-Id: I257712521e8e77fa66e76857489797ecc675506e
(cherry picked from commit a9a9718bb1f64318429562ecdaa3d3763d9e2f4a)
Reviewed-on: https://gerrit.libreoffice.org/12269
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/data/fdo85812.rtf 
b/sw/qa/extras/rtfimport/data/fdo85812.rtf
new file mode 100644
index 000..152971f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo85812.rtf
@@ -0,0 +1,39 @@
+{\rtf1\ansi\deflang1049\deflangfe2052
+{\*\generator Microsoft Word 11.0.5604;}
+
+\pard\plain
+\lang1049\langfe2052\loch\hich\dbch\langnp1049\langfenp2052
+{\lang1033\langfe2052\dbch\langnp1033 \hich\dbch\loch This }
+
+\par\pard\plain
+\lang1049\langfe2052\loch\hich\dbch
+{CharGroup}
+\lang1033 AfterChar
+
+\par\pard\plain
+\lang1049\langfe2052\loch\hich\dbch
+{\*\bkmkstart foomark}{\*\bkmkend foomark}
+\lang1033 AfterBookmark
+
+\par\pard\plain
+\lang1049\langfe2052\loch\hich\lang5121\dbch\lang1049
+{CharGroup}
+\lang1033 AfterChar
+
+\par\pard\plain
+\lang1049\langfe2052\loch\hich\lang5121\dbch\lang1049
+{\*\bkmkstart foomark}{\*\bkmkend foomark}
+\lang1033 AfterBookmark
+
+\par\pard\plain
+\lang1049\langfe2052\ltrch\lang1033\rtlch\lang5121
+{CharGroup}
+\lang3073 AfterChar
+
+\par\pard\plain
+\lang1049\langfe2052\ltrch\lang1033\rtlch\lang5121
+{\*\bkmkstart foomark}{\*\bkmkend foomark}
+\lang3073 AfterBookmark
+
+{\lang1036\langfe2052\langnp1036 \par }
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 1c3ed00..93e1904 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -475,6 +475,78 @@ DECLARE_RTFIMPORT_TEST(testFdo48037, fdo48037.rtf)
 CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo85812, fdo85812.rtf)
+{
+lang::Locale locale(getPropertylang::Locale(
+getRun(getParagraph(1), 1, This ), CharLocale));
+// the \lang inside the group was applied to CJK not Western
+CPPUNIT_ASSERT_EQUAL(OUString(en), locale.Language);
+CPPUNIT_ASSERT_EQUAL(OUString(US), locale.Country);
+// further testing indicates that Word is doing really weird stuff
+// \loch \hich \dbch is reset by opening a group
+locale = getPropertylang::Locale(
+getRun(getParagraph(2), 1, CharGroup), CharLocale);
+CPPUNIT_ASSERT_EQUAL(OUString(ru), locale.Language);
+CPPUNIT_ASSERT_EQUAL(OUString(RU), locale.Country);
+locale = getPropertylang::Locale(
+getRun(getParagraph(2), 2, AfterChar), CharLocale);
+CPPUNIT_ASSERT_EQUAL(OUString(en), locale.Language);
+CPPUNIT_ASSERT_EQUAL(OUString(US), locale.Country);
+locale = getPropertylang::Locale(
+getRun(getParagraph(3), 2, AfterBookmark), CharLocale);
+CPPUNIT_ASSERT_EQUAL(OUString(en), locale.Language);
+CPPUNIT_ASSERT_EQUAL(OUString(US), locale.Country);
+locale = getPropertylang::Locale(
+getRun(getParagraph(4), 1, CharGroup), CharLocale);
+CPPUNIT_ASSERT_EQUAL(OUString(ru), locale.Language);
+CPPUNIT_ASSERT_EQUAL(OUString(RU), locale.Country);
+locale = getPropertylang::Locale(
+getRun(getParagraph(4), 1, CharGroup), CharLocaleComplex);
+CPPUNIT_ASSERT_EQUAL(OUString(ar), locale.Language);
+CPPUNIT_ASSERT_EQUAL(OUString(DZ), locale.Country);
+locale = getPropertylang::Locale(
+getRun(getParagraph(4), 2, AfterChar), CharLocale);
+CPPUNIT_ASSERT_EQUAL(OUString(en), locale.Language);
+CPPUNIT_ASSERT_EQUAL(OUString(US), locale.Country);
+locale = getPropertylang::Locale(
+getRun(getParagraph(4), 2, AfterChar), CharLocaleComplex);
+CPPUNIT_ASSERT_EQUAL(OUString(ar), locale.Language);
+CPPUNIT_ASSERT_EQUAL(OUString(DZ), locale.Country);
+locale = getPropertylang::Locale(
+getRun(getParagraph(5), 2, AfterBookmark), CharLocale);
+CPPUNIT_ASSERT_EQUAL(OUString(en), locale.Language);
+CPPUNIT_ASSERT_EQUAL(OUString(US), locale.Country);
+locale = getPropertylang::Locale(
+

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa

2014-11-06 Thread Stephan Bergmann
 sw/qa/extras/ww8export/ww8export.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c244e2e2d64ee88e0e3f44f573247c8ce566e190
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Nov 6 15:36:41 2014 +0100

Fix cherry-pick mis-merge

82c01116a7df315b78bfd3af6ccd936572b45d78 bnc#636128 DOC filter: fix 
handling of FFData.cch

Change-Id: I7d26c5950c3265db10e1611402ab3b63abbe2d4a

diff --git a/sw/qa/extras/ww8export/ww8export.cxx 
b/sw/qa/extras/ww8export/ww8export.cxx
index 3a9cf7c..050b270 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -346,7 +346,6 @@ DECLARE_WW8EXPORT_TEST(testBorderColoursExport, 
bordercolours.odt)
 CPPUNIT_ASSERT_BORDER_EQUAL(expectedBottom, border);
 #endif
 }
-#endif
 
 DECLARE_WW8EXPORT_TEST(testBnc636128, bnc636128.doc)
 {
@@ -356,6 +355,7 @@ DECLARE_WW8EXPORT_TEST(testBnc636128, bnc636128.doc)
 // This resulted in a container.NoSuchElementException.
 CPPUNIT_ASSERT_EQUAL(OUString(5), 
xParameters-getByName(MaxLength).getOUString());
 }
+#endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa

2014-11-04 Thread Michael Stahl
 sw/qa/extras/htmlexport/htmlexport.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit be7e9d72f4ca87476fbeda5bed48732244dc588b
Author: Michael Stahl mst...@redhat.com
Date:   Tue Nov 4 12:23:06 2014 +0100

sw: fix windows build

Change-Id: I24aedc513897579b3f3c3bf9884183a67b93cd39

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index faa3d4f..15834fe 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -162,8 +162,6 @@ DECLARE_HTMLEXPORT_TEST(testSkipImageEmbeddedDocument, 
skipimage-embedded-docum
 assertXPathContent(pDoc, /html/body/p/span/p/span, Inner.);
 }
 
-#endif
-
 DECLARE_HTMLEXPORT_TEST(testExportCheckboxRadioButtonState, 
checkbox-radiobutton.doc)
 {
 htmlDocPtr pDoc = parseHtml(maTempFile);
@@ -183,6 +181,7 @@ DECLARE_HTMLEXPORT_TEST(testExportCheckboxRadioButtonState, 
checkbox-radiobutto
 assertXPath(pDoc, /html/body/form/p[4]/input, type, radio);
 // FIXME not in 4.3 assertXPathNoAttribute(pDoc, 
/html/body/form/p[4]/input, checked);
 }
+#endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-11-04 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo82076.rtf   |   13 +
 sw/qa/extras/rtfimport/rtfimport.cxx   |   11 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   19 ++-
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |3 ++-
 4 files changed, 44 insertions(+), 2 deletions(-)

New commits:
commit db8cc3a1c481bd1f97b2688ff85a00eec8b25926
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Oct 26 12:53:05 2014 +0100

fdo#82076 RTF import: handle footnote in table cell

(cherry picked from commit 956c3ff3d43e1b181f7c91518edee1c7c4dc2a0a)

Change-Id: I69def7936c320e93db5d4504922d52346caaf9cf
Reviewed-on: https://gerrit.libreoffice.org/12242
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo82076.rtf 
b/sw/qa/extras/rtfimport/data/fdo82076.rtf
new file mode 100644
index 000..20b33e9
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo82076.rtf
@@ -0,0 +1,13 @@
+{\rtf1
+\pard\plain
+Before
+\par
+\trowd \cellx4000\cellx8000
+A1\cell
+B1
+{\chftn
+{\footnote Footnote}
+}
+\cell\row
+\pard After\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 520beee..1c3ed00 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1920,6 +1920,17 @@ DECLARE_RTFIMPORT_TEST(testFdo82859, fdo82859.rtf)
 CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(-1), 
getPropertysal_Int32(getShape(1), BackColor));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo82076, fdo82076.rtf)
+{
+// Footnote position was wrong: should be at the end of the B1 cell.
+uno::Referencetext::XTextTablesSupplier xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xTables(xTextTablesSupplier-getTextTables(), uno::UNO_QUERY);
+uno::Referencetext::XTextTable xTable(xTables-getByIndex(0), 
uno::UNO_QUERY);
+uno::Referencetext::XTextRange xCell(xTable-getCellByName(B1), 
uno::UNO_QUERY);
+// This resulted in container::NoSuchElementException: the footnote was at 
the start of the A1 cell.
+CPPUNIT_ASSERT_EQUAL(OUString(Footnote), 
getPropertyOUString(getRun(getParagraphOfText(1, xCell-getText()), 2), 
TextPortionType));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 9339c51..145fd4a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1452,6 +1452,14 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t rBuffer,
 RTFSdrImport::SHAPE);
 else if (boost::get0(aTuple) == BUFFER_ENDSHAPE)
 m_pSdrImport-close();
+else if (boost::get0(aTuple) == BUFFER_RESOLVESUBSTREAM)
+{
+RTFSprms rAttributes = boost::get1(aTuple)-getAttributes();
+sal_Size nPos = rAttributes.find(0)-getInt();
+Id nId = rAttributes.find(1)-getInt();
+OUString aCustomMark = rAttributes.find(2)-getString();
+resolveSubstream(nPos, nId, aCustomMark);
+}
 else
 assert(false);
 }
@@ -1668,7 +1676,16 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 m_aStates.top().nDestinationState = DESTINATION_FOOTNOTE;
 if (bCustomMark)
 Mapper().startCharacterGroup();
-resolveSubstream(m_nGroupStartPos - 1, nId, aCustomMark);
+if (!m_aStates.top().pCurrentBuffer)
+resolveSubstream(m_nGroupStartPos - 1, nId, aCustomMark);
+else
+{
+RTFSprms aAttributes;
+aAttributes.set(Id(0), RTFValue::Pointer_t(new 
RTFValue(m_nGroupStartPos - 1)));
+aAttributes.set(Id(1), RTFValue::Pointer_t(new 
RTFValue(nId)));
+aAttributes.set(Id(2), RTFValue::Pointer_t(new 
RTFValue(aCustomMark)));
+
m_aStates.top().pCurrentBuffer-push_back(Buf_t(BUFFER_RESOLVESUBSTREAM, 
RTFValue::Pointer_t(new RTFValue(aAttributes;
+}
 if (bCustomMark)
 {
 m_aStates.top().aCharacterAttributes.clear();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 98a5523..3cc9c51 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -55,7 +55,8 @@ enum RTFBufferTypes
 BUFFER_ENDRUN,
 BUFFER_PAR,
 BUFFER_STARTSHAPE,
-BUFFER_ENDSHAPE
+BUFFER_ENDSHAPE,
+BUFFER_RESOLVESUBSTREAM
 };
 
 /// Form field types
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa

2014-11-04 Thread Miklos Vajna
 sw/qa/extras/rtfexport/rtfexport.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 026d048e896683a0630ee08879f2f2e5bff89284
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Nov 4 16:48:29 2014 +0100

CppunitTest_sw_rtfexport: fix windows build

Change-Id: I79d4e46abe289b3d9c1f0a2eec2a29045891cae3

diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index 0f53098..0bcf1a8 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -659,14 +659,14 @@ DECLARE_RTFEXPORT_TEST(testFdo79599, fdo79599.rtf)
 CPPUNIT_ASSERT_EQUAL(sal_uInt32(0x800080), getPropertysal_uInt32(xRun, 
CharBackColor));
 }
 
-#endif
-
 DECLARE_RTFEXPORT_TEST(testFdo82858, fdo82858.docx)
 {
 // This was table::BorderLineStyle::SOLID, exporter failed to write 
explicit no line when line color was written.
 CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::NONE, 
getPropertytable::BorderLine2(getShape(1), TopBorder).LineStyle);
 }
 
+#endif
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-10-30 Thread Miklos Vajna
 sw/qa/core/data/rtf/pass/fdo82859.rtf   |   25 +
 writerfilter/source/rtftok/rtfsdrimport.cxx |2 +-
 2 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 22f307bc19d5acd0c4cb71e8e122e57bd6afc568
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Oct 24 16:21:51 2014 +0200

fdo#82859 RTF import: don't try to set CustomShapeGeometry on a TextFrame

(cherry picked from commit 6b7239855d8babdc1bcc7742f79ce2df64d1e476)

Conflicts:
writerfilter/source/rtftok/rtfsdrimport.cxx

Change-Id: I687fa609559f0484fe6bb804265243de154c3760
Reviewed-on: https://gerrit.libreoffice.org/12122
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/core/data/rtf/pass/fdo82859.rtf 
b/sw/qa/core/data/rtf/pass/fdo82859.rtf
new file mode 100644
index 000..72b1576
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/fdo82859.rtf
@@ -0,0 +1,25 @@
+{\rtf1
+{\field
+{\*\fldinst SHAPE }
+{\fldrslt
+{\shp
+{\*\shpinst\shpleft-90\shptop720\shpright9404\shpbottom2939\shpwr2\shpbxignore\shpbyignore
+{\sp
+{\sn shapeType}
+{\sv 1}
+}
+{\sp
+{\sn pVerticies}
+{\sv 8;4;(0,0);(-2147483645,0);(-2147483645,-2147483646);(0,-2147483646)}
+}
+{\sp
+{\sn pSegmentInfo}
+{\sv 2;4;16384;3;24577;32768}
+}
+{\shptxt hello}
+}
+}
+}
+}
+\par
+}
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx 
b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 3d62a447..7afcfb0 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -793,7 +793,7 @@ void RTFSdrImport::resolve(RTFShape rShape, bool bClose, 
ShapeOrPict const shap
 beans::PropertyValue* pGeomValues = aGeomPropSeq.getArray();
 for (std::vectorbeans::PropertyValue::iterator i = aGeomPropVec.begin(); 
i != aGeomPropVec.end(); ++i)
 *pGeomValues++ = *i;
-if (aGeomPropSeq.getLength()  xPropertySet.is())
+if (aGeomPropSeq.getLength()  xPropertySet.is()  !m_bTextFrame)
 xPropertySet-setPropertyValue(CustomShapeGeometry, 
uno::Any(aGeomPropSeq));
 
 // Set position and size
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-10-30 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo82859.rtf|   25 +
 sw/qa/extras/rtfimport/rtfimport.cxx|6 ++
 writerfilter/source/rtftok/rtfsdrimport.cxx |2 +-
 3 files changed, 32 insertions(+), 1 deletion(-)

New commits:
commit 9f89fbf3be626b13799b1b9c0fb8ca246148bcfb
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Oct 25 10:36:10 2014 +0200

fdo#82859 RTF import: fillColor is unsigned

Otherwise ARGB 0x would turn into black.

(cherry picked from commit 04ea7b24ec1b5a027efa0b850f2bc3ac7116c52e)

Change-Id: I690f34d888ca9a013e8ce1af2c7ef8ed88ee28b0
Reviewed-on: https://gerrit.libreoffice.org/12153
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo82859.rtf 
b/sw/qa/extras/rtfimport/data/fdo82859.rtf
new file mode 100644
index 000..eac5e6f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo82859.rtf
@@ -0,0 +1,25 @@
+{\rtf1
+{\shp
+{\*\shpinst\shpbypara\shpbyignore\shptop4154\shpbottom11234\shpbxcolumn\shpbxignore\shpleft-90\shpright9270
+{\sp
+{\sn fillColor}
+{\sv 4294967295}
+}
+{\sp
+{\sn shapeType}
+{\sv 202}
+}
+{\sp
+{\sn posrelv}
+{\sv 2}
+}
+{\sp
+{\sn posrelh}
+{\sv 2}
+}
+{\shptxt
+}
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index d4cb897..520beee 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1914,6 +1914,12 @@ DECLARE_RTFIMPORT_TEST(testFdo85179, fdo85179.rtf)
 CPPUNIT_ASSERT_EQUAL(sal_uInt32(50800/360), 
getPropertytable::BorderLine2(getShape(1), TopBorder).LineWidth);
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo82859, fdo82859.rtf)
+{
+// This was 0: 0xff was converted to 0, i.e. the background was 
black instead of the default.
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(-1), 
getPropertysal_Int32(getShape(1), BackColor));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx 
b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 7afcfb0..acbe6a2 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -358,7 +358,7 @@ void RTFSdrImport::resolve(RTFShape rShape, bool bClose, 
ShapeOrPict const shap
 }
 else if (i-first == fillColor  xPropertySet.is())
 {
-aAny = msfilter::util::BGRToRGB(i-second.toInt32());
+aAny = msfilter::util::BGRToRGB(i-second.toUInt32());
 if (m_bTextFrame)
 xPropertySet-setPropertyValue(BackColor, aAny);
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-10-27 Thread Miklos Vajna
 sw/qa/extras/htmlexport/htmlexport.cxx|4 +--
 sw/qa/extras/rtfimport/data/fdo85179.rtf  |   33 ++
 sw/qa/extras/rtfimport/rtfimport.cxx  |7 +
 writerfilter/source/dmapper/GraphicImport.cxx |   32 +++--
 writerfilter/source/dmapper/GraphicImport.hxx |2 -
 5 files changed, 68 insertions(+), 10 deletions(-)

New commits:
commit 07f36a421461217a78e61d97e86760738acabbe6
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Oct 23 17:09:25 2014 +0200

fdo#85179 RTF filter: import image border

Also adjust CppunitTest_sw_htmlexport that implicitly tested that there
is no color around the image.

(cherry picked from commit 01a32b7d074511bed24044dc94e1159aea62722b)

Conflicts:
writerfilter/source/dmapper/GraphicImport.cxx

Change-Id: I8e14dfa7e7be80c4f8c492999071decae6a492e8
Reviewed-on: https://gerrit.libreoffice.org/12092
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index a59515e..faa3d4f 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -122,7 +122,7 @@ DECLARE_HTMLEXPORT_TEST(testExportOfImages, 
textAndImage.docx)
 CPPUNIT_ASSERT(pDoc);
 
 assertXPath(pDoc, /html/body, 1);
-assertXPath(pDoc, /html/body/p/img, 1);
+assertXPath(pDoc, /html/body/p/font/img, 1);
 }
 
 DECLARE_HTMLEXPORT_TEST(testExportOfImagesWithSkipImageEnabled, 
textAndImage.docx)
@@ -131,7 +131,7 @@ 
DECLARE_HTMLEXPORT_TEST(testExportOfImagesWithSkipImageEnabled, textAndImage.do
 CPPUNIT_ASSERT(pDoc);
 
 assertXPath(pDoc, /html/body, 1);
-assertXPath(pDoc, /html/body/p/img, 0);
+assertXPath(pDoc, /html/body/p/font/img, 0);
 }
 
 DECLARE_HTMLEXPORT_TEST(testSkipImageEmbedded, skipimage-embedded.doc)
diff --git a/sw/qa/extras/rtfimport/data/fdo85179.rtf 
b/sw/qa/extras/rtfimport/data/fdo85179.rtf
new file mode 100644
index 000..fb9bcfa
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo85179.rtf
@@ -0,0 +1,33 @@
+{\rtf1
+\pard\plain
+{\*\shppict
+{\pict
+{\*\picprop\shplid1025
+{\sp
+{\sn shapeType}
+{\sv 75}
+}
+{\sp
+{\sn lineColor}
+{\sv 65535}
+}
+{\sp
+{\sn lineWidth}
+{\sv 50800}
+}
+}
+\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw1806\pich1806\picwgoal1024\pichgoal1024\pngblip
+89504e470d0a1a0a000d4948445200400040080460b955000467414d41b18f0bfc610500017352474200aece1ce9
+00206348524d7a268084fa0080e87530ea603a9817709cba513c0002624b4744aa8d233200096f464673
+0006000c7355d30009704859730dd70dd70142289b78000976704167004c0040009d31381b01cd4944415468
+deedd93d4fc24018c0f17f89c6cdc44940e3e222be2c0e7e0417e3a8113571707632514012a320c6f84d34be2c2ec2b750f40be8e6e4a00113cfe14a5b69b108
+f4589ee71652eefafce0b9f42e3d7063822aaac3f641d173a75d3efee85b6582c0c8749c5eb7332cfb4e6f213d336ed29807304477b1c7a94db80ae9e9c934d0
+fcdd12e7ffcefcc9168f9a0059143b8cb0d2de581f609854073fbecc220f60b18722479d0d14abed8c8cb5d3293ce2949903b0d8a7047cb1c98541008cba840c
+a736e1d2200046b967567f740961d3b197008873cf74835002eaac736319ca0d4296121675d2dc1a0440d2256428625163ed2f42cf011e8245d621b42c44
+0400485261a699706d192fa100d4490713220240dc25e438b1090185880ca09f8ece5c28d9843b009e82471ca25069d5cb785529bd007fdbfb8541b65b2f
+531100947a51530d42c1d92f9829818e31ca4ce9421c70e427440e80712a7a89b7c8fb0906003046a5311df31cf501a01f4d0ee1b80f00bd4c398558ee0340ff
+0b939a30df17002459f05d330a080a0108421084210842108421f8ce0ddf798e30dd7b38e0ce7ea16d2abc25a819cbda225337c7
+f7ff69bf8eef7f0084e08d42bdf8a03e0025744558746372656174652d6461746500323031302d31322d32305431373a30383a33362b30313a30307ae51b1c0025744558746d6f646966792d6461746500323031302d31322d32305431373a30383a33372b30313a30308323669c49454e44ae4260820a}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 24afe98..d4cb897 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1907,6 +1907,13 @@ DECLARE_RTFIMPORT_TEST(testFdo83464, fdo83464.rtf)
 CPPUNIT_ASSERT_EQUAL(OUString(Verdana), 
getPropertyOUString(getRun(getParagraphOfText(1, xFrameText-getText()), 1), 
CharFontName));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo85179, fdo85179.rtf)
+{
+// This was 0, border around the picture was ignored on import.
+// 360: EMU - MM100
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(50800/360), 
getPropertytable::BorderLine2(getShape(1), TopBorder).LineWidth);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx 
b/writerfilter/source/dmapper/GraphicImport.cxx
index 4c68904..f53f7f3 100644
--- 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-10-20 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo83464.rtf   |   24 
 sw/qa/extras/rtfimport/rtfimport.cxx   |9 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 ++
 3 files changed, 35 insertions(+)

New commits:
commit 8cca66b47ca6d94b21d740089b2a3bae1c0566ff
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Oct 19 10:35:45 2014 +0200

fdo#83464 RTF import: \plain should reset \rtlch and \hich as well

Regression from 36246aa9fb57c9fe4e546c91a8274d8828b1424e (RTF import:
fix handling of \loch \hich \dbch \ltrch \rtlch, 2014-06-03), now that
\f no longer means the ascii font name, \plain should reset a few more
parser state members.

(cherry picked from commit 69bf37136c1386c7220f38a896aa9865bdae665f)

Conflicts:
sw/qa/extras/rtfimport/rtfimport.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx

Change-Id: Ia6b0bdf25563dd5300e108b46731751f0886f67d
Reviewed-on: https://gerrit.libreoffice.org/12034
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sw/qa/extras/rtfimport/data/fdo83464.rtf 
b/sw/qa/extras/rtfimport/data/fdo83464.rtf
new file mode 100644
index 000..28c9202
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo83464.rtf
@@ -0,0 +1,24 @@
+{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs1025
+{\fonttbl
+{\f0\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\f39\fbidi \fswiss\fcharset0\fprq2 Verdana;}
+}
+{\stylesheet
+{\s43\ql \f39\fs16 Table Text;}
+}
+\pard\plain \ltrpar\ql 
\li0\ri0\sb60\sa60\widctlpar\tx360\jclisttab\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5400\tx5760\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10449364
 \rtlch\fcs1 \af0\afs18\alang1037 \ltrch\fcs0 
\fs16\lang1024\langfe1024\loch\af2\hich\af2\dbch\af35\cgrid\noproof\langnp1033\langfenp1033
 
+\par
+{\rtlch\fcs1 \ltrch\fcs0 \insrsid11419963 
+{\shp
+{\*\shpinst\shpleft-90\shptop720\shpright9405\shpbottom2940\shpfhdr0\shpbxcolumn\shpbxignore\shpbymargin\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz2\shplid1027
+{\sp
+{\sn shapeType}
+{\sv 202}
+}
+{\shptxt \pard\plain\f39\fs16 Hello\par
+}
+}
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index cc51a42..24afe98 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1898,6 +1898,15 @@ DECLARE_RTFIMPORT_TEST(testFdo84679, fdo84679.rtf)
 CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(0), 
getPropertysal_Int32(getParagraphOfText(1, xCell-getText()), 
ParaBottomMargin));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo83464, fdo83464.rtf)
+{
+// Problem was that the text in the textfrme had wrong font.
+uno::Referencetext::XTextRange xFrameText(getShape(1), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString(Hello), xFrameText-getString());
+// This was Times New Roman.
+CPPUNIT_ASSERT_EQUAL(OUString(Verdana), 
getPropertyOUString(getRun(getParagraphOfText(1, xFrameText-getText()), 1), 
CharFontName));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 3fdc5ef..9339c51 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2812,6 +2812,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 m_aStates.top().aCharacterSprms = getDefaultState().aCharacterSprms;
 m_aStates.top().nCurrentEncoding = 
getEncoding(getFontIndex(m_nDefaultFontIndex));
 m_aStates.top().aCharacterAttributes = 
getDefaultState().aCharacterAttributes;
+m_aStates.top().isRightToLeft = false;
+m_aStates.top().eRunType = RTFParserState::LOCH;
 }
 break;
 case RTF_PARD:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa

2014-10-20 Thread Jan Holesovsky
 sw/qa/extras/htmlexport/htmlexport.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9971bedd0fcdddf741b312a4d02aeb1f703ef2a9
Author: Jan Holesovsky ke...@collabora.com
Date:   Mon Oct 20 18:13:34 2014 +0200

Fix build breakage.

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 9e666a8..a59515e 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -173,15 +173,15 @@ 
DECLARE_HTMLEXPORT_TEST(testExportCheckboxRadioButtonState, checkbox-radiobutto
 assertXPath(pDoc, /html/body/p[1]/input, type, checkbox);
 assertXPath(pDoc, /html/body/p[1]/input, checked, checked);
 assertXPath(pDoc, /html/body/p[2]/input, type, checkbox);
-assertXPathNoAttribute(pDoc, /html/body/p[2]/input, checked);
+// FIXME not in 4.3 assertXPathNoAttribute(pDoc, /html/body/p[2]/input, 
checked);
 assertXPath(pDoc, /html/body/form/p[1]/input, type, checkbox);
 assertXPath(pDoc, /html/body/form/p[1]/input, checked, checked);
 assertXPath(pDoc, /html/body/form/p[2]/input, type, checkbox);
-assertXPathNoAttribute(pDoc, /html/body/form/p[2]/input, checked);
+// FIXME not in 4.3 assertXPathNoAttribute(pDoc, 
/html/body/form/p[2]/input, checked);
 assertXPath(pDoc, /html/body/form/p[3]/input, type, radio);
 assertXPath(pDoc, /html/body/form/p[3]/input, checked, checked);
 assertXPath(pDoc, /html/body/form/p[4]/input, type, radio);
-assertXPathNoAttribute(pDoc, /html/body/form/p[4]/input, checked);
+// FIXME not in 4.3 assertXPathNoAttribute(pDoc, 
/html/body/form/p[4]/input, checked);
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-10-11 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo84679.rtf   |   12 
 sw/qa/extras/rtfimport/rtfimport.cxx   |   11 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |9 +
 3 files changed, 28 insertions(+), 4 deletions(-)

New commits:
commit a3cd122a8fbf5788d39491134c00e75149032783
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Oct 10 16:21:29 2014 +0200

fdo#84679 RTF import: fix paragraph spacing handling in tables

Regression from commit 1be0a3fa9ebb22b607c54b47739d4467acfed259
(n#825305: writerfilter RTF import: override style properties like Word,
2014-06-17), we failed to do the proper deduplication in buffered
content, like tables. Fix this by adapting
RTFDocumentImpl::replayBuffer() to RTFDocumentImpl::checkNeedPap(),
which already did the proper deduplication.

To be fair, the inconsistency was there earlier since
9f5263c477b82fef5aa9c3e79fb6af92aa049e24 (fdo#44736 RTF import: ignore
direct formatting which equals to style, 2012-11-25), but it caused no
real harm earlier.

(cherry picked from commit e34906d20c9febc420b115fa2a8b171826dea0be)

Change-Id: I0673408088d9d83768f0780ea92ece87913d03f3
Reviewed-on: https://gerrit.libreoffice.org/11914
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo84679.rtf 
b/sw/qa/extras/rtfimport/data/fdo84679.rtf
new file mode 100644
index 000..64611be
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo84679.rtf
@@ -0,0 +1,12 @@
+{\rtf1
+{\stylesheet
+{\ql 
\sa160\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 
\rtlch\fcs1 
+\af31507\afs28\alang1054 \ltrch\fcs0 
\fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
 \snext0 \sqformat \spriority0 Normal;}
+}
+\pard\plain\par
+\trowd
+\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 
\clbrdrr\brdrs\brdrw10\cellx3121
+\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 
\clbrdrr\brdrs\brdrw10\cellx6238
+A1\cell A2\cell \row
+\pard\plain\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 12c6b52..cc51a42 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1887,6 +1887,17 @@ DECLARE_RTFIMPORT_TEST(testPictureWrapPolygon, 
picture-wrap-polygon.rtf)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-67)), 
getPropertysal_Int32(getShape(1), VertOrientPosition));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo84679, fdo84679.rtf)
+{
+// The problem was that the paragraph in A1 had some bottom margin, but it 
should not.
+uno::Referencetext::XTextTablesSupplier xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xTables(xTextTablesSupplier-getTextTables(), uno::UNO_QUERY);
+uno::Referencetext::XTextTable xTable(xTables-getByIndex(0), 
uno::UNO_QUERY);
+uno::Referencetext::XTextRange xCell(xTable-getCellByName(A1), 
uno::UNO_QUERY);
+// This was 282.
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(0), 
getPropertysal_Int32(getParagraphOfText(1, xCell-getText()), 
ParaBottomMargin));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 9f35f26..3fdc5ef 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -445,7 +445,9 @@ void RTFDocumentImpl::setNeedSect(bool bNeedSect)
 
 writerfilter::ReferenceProperties::Pointer_t 
RTFDocumentImpl::getProperties(RTFSprms rAttributes, RTFSprms rSprms)
 {
-int nStyle = m_aStates.top().nCurrentStyleIndex;
+int nStyle = 0;
+if (!m_aStates.empty())
+nStyle = m_aStates.top().nCurrentStyleIndex;
 RTFReferenceTable::Entries_t::iterator it = 
m_aStyleTableEntries.find(nStyle);
 if (it != m_aStyleTableEntries.end())
 {
@@ -1402,10 +1404,9 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t rBuffer,
 rBuffer.pop_front();
 if (boost::get0(aTuple) == BUFFER_PROPS)
 {
+// Construct properties via getProperties() and not directly, to 
take care of deduplication.
 writerfilter::ReferenceProperties::Pointer_t const pProp(
-new RTFReferenceProperties(
-boost::get1(aTuple)-getAttributes(),
-boost::get1(aTuple)-getSprms())
+getProperties(boost::get1(aTuple)-getAttributes(), 
boost::get1(aTuple)-getSprms())
 );
 Mapper().props(pProp);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa

2014-10-02 Thread Andras Timar
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 813a0de2e133da55a0450a9d24ec10e040bc5cd6
Author: Andras Timar andras.ti...@collabora.com
Date:   Thu Oct 2 23:28:34 2014 +0200

fix Windows build again

Change-Id: I7f671af4f4841bf68496f99ef8ae14adf801713d

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 6c46d98..2fe437b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3669,8 +3669,6 @@ DECLARE_OOXMLEXPORT_TEST(testfdo78907,fdo78907.docx)
 assertXPath ( pXmlDoc1, 
/w:ftr[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl, 0 );
 }
 
-#endif
-
 DECLARE_OOXMLEXPORT_TEST(testMsoPosition, bnc884615-mso-position.docx)
 {
 if(xmlDocPtr doc = parseExport(word/footer1.xml))
@@ -3708,6 +3706,8 @@ DECLARE_OOXMLEXPORT_TEST(testMsoPosition, 
bnc884615-mso-position.docx)
 }
 }
 
+#endif
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-10-01 Thread Caolán McNamara
 sw/qa/core/data/ooxml/pass/fdo73608-1.docx   |binary
 sw/qa/core/data/ooxml/pass/fdo73608-2.docx   |binary
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   16 ++-
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit dea3d98936aad30a7d6804c76e502c9fc9603985
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Sep 28 16:47:13 2014 +0100

Related: fdo#73608 don't crash on missing table styles

(cherry picked from commit 5fd7382651d64f77e8ad1d9a5c053f52f3641f9f)

Conflicts:
writerfilter/source/dmapper/DomainMapperTableHandler.cxx

Change-Id: I340b43b7afc4c5c4d6dc8e4ed182279240306540

Resolves: fdo#73608 bail out on loop in style sheet hierarchy

Change-Id: I03975d1ce8eaceceb4d5c263eb11c1521bcd57eb
(cherry picked from commit be18133e84120625734a09380594ee89b23c4322)
Reviewed-on: https://gerrit.libreoffice.org/11679
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/core/data/ooxml/pass/fdo73608-1.docx 
b/sw/qa/core/data/ooxml/pass/fdo73608-1.docx
new file mode 100644
index 000..d3cc84a
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo73608-1.docx differ
diff --git a/sw/qa/core/data/ooxml/pass/fdo73608-2.docx 
b/sw/qa/core/data/ooxml/pass/fdo73608-2.docx
new file mode 100644
index 000..f558878
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo73608-2.docx differ
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 33f70cc..b8193c7 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -119,9 +119,17 @@ void DomainMapperTableHandler::startTable(unsigned int 
nRows,
 PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const 
StyleSheetEntryPtr pStyleSheet, StyleSheetTablePtr pStyleSheetTable)
 {
 PropertyMapPtr pRet;
+
+if (!pStyleSheet)
+return pRet;
+
 if(!pStyleSheet-sBaseStyleIdentifier.isEmpty())
 {
 const StyleSheetEntryPtr pParentStyleSheet = 
pStyleSheetTable-FindStyleSheetByISTD( pStyleSheet-sBaseStyleIdentifier );
+//a loop in the style hierarchy, bail out
+if (pParentStyleSheet == pStyleSheet)
+return pRet;
+
 pRet = lcl_SearchParentStyleSheetAndMergeProperties( 
pParentStyleSheet, pStyleSheetTable );
 }
 else
@@ -129,7 +137,10 @@ PropertyMapPtr 
lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntr
 pRet.reset( new PropertyMap );
 }
 
-pRet-InsertProps(pStyleSheet-pProperties);
+if (pRet)
+{
+pRet-InsertProps(pStyleSheet-pProperties);
+}
 
 return pRet;
 }
@@ -294,6 +305,9 @@ namespace
 
 bool lcl_extractTableBorderProperty(PropertyMapPtr pTableProperties, const 
PropertyIds nId, TableInfo rInfo, table::BorderLine2 rLine)
 {
+if (!pTableProperties)
+return false;
+
 PropertyMap::iterator aTblBorderIter = pTableProperties-find(nId);
 if( aTblBorderIter != pTableProperties-end() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-10-01 Thread PriyankaGaikwad
 sw/qa/extras/ooxmlexport/data/fdo78907.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx|   13 +
 sw/source/filter/ww8/ww8atr.cxx |2 +-
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 4e41b9b6e3da0b29f213df7745ac286bcbab6270
Author: PriyankaGaikwad priyanka.gaik...@synerzip.com
Date:   Fri May 30 17:23:45 2014 +0530

fdo#78907 fdo#82895 : File crashed while saving.

   - There is pagebreak in file and footer has nested table.
   - While exporting LO write section break instead of PAGE_BREAK.
   - Due to this it was writing two sections in file and same footer
 for both sections.
   - This was causing wrong table depth values due to this it was crashing
 while writing table.
   - So in MSWordExportBase::OutputSectionBreaks if next node has
 RES_BREAK(page break) then bNewPageDesc value should be false.

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

Change-Id: I2ccc4e48a26253716253a7280a244f06e172770a

diff --git a/sw/qa/extras/ooxmlexport/data/fdo78907.docx 
b/sw/qa/extras/ooxmlexport/data/fdo78907.docx
new file mode 100644
index 000..abae6b4
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78907.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 18c15fa..6c46d98 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3656,6 +3656,19 @@ DECLARE_OOXMLEXPORT_TEST(testFooterBodyDistance, 
footer-body-distance.docx)
 assertXPath(pXmlDoc, /w:document/w:body/w:p/w:r/w:br, 1);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testfdo78907,fdo78907.docx)
+{
+xmlDocPtr pXmlDoc = parseExport(word/document.xml);
+if (!pXmlDoc)
+return;
+assertXPath ( pXmlDoc, /w:document/w:body/w:p[1]/w:r[2]/w:br, type, 
page );
+
+xmlDocPtr pXmlDoc1 = parseExport(word/footer1.xml);
+if (!pXmlDoc1)
+return;
+assertXPath ( pXmlDoc1, 
/w:ftr[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tbl, 0 );
+}
+
 #endif
 
 DECLARE_OOXMLEXPORT_TEST(testMsoPosition, bnc884615-mso-position.docx)
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 6065d19..c364d20 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -478,7 +478,7 @@ void MSWordExportBase::OutputSectionBreaks( const 
SfxItemSet *pSet, const SwNode
 }
 }
 }
-
+bNewPageDesc = false; // if next node has RES_BREAK(page break) 
then bNewPageDesc value should be false.
 bBreakSet = true;
 
 if ( !bRemoveHardBreakInsideTable )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-10-01 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 902de8a1cbdb86c1eb1a05c8307b109fd75f493c
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...

Change-Id: I485d8089c1fb5ba3ca369fbfe8f3115bf700ba13
Reviewed-on: https://gerrit.libreoffice.org/11722
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

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 8cd4b09..36aa437 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 5c24b91..4ed26e0 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -462,6 +462,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));
+if (SFX_ITEM_SET != eState 
+rPropName == UNO_NAME_FIRST_IS_SHARED)
+{   // fdo#79269 header may not exist, check footer then
+eState = rSet.GetItemState(
+(!bFooter) ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
+false, reinterpret_castconst SfxPoolItem**(o_rpItem));
+}
+return SFX_ITEM_SET == eState;
+}

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-09-25 Thread Luboš Luňák
 sw/qa/extras/ooxmlimport/data/bnc891663.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |9 +
 writerfilter/source/dmapper/GraphicImport.cxx |8 
 writerfilter/source/dmapper/PropertyIds.cxx   |1 +
 writerfilter/source/dmapper/PropertyIds.hxx   |1 +
 5 files changed, 19 insertions(+)

New commits:
commit 19af97e868c6a2b2578509a24ef0e7a88e5515bc
Author: Luboš Luňák l.lu...@collabora.com
Date:   Sun Sep 21 17:52:58 2014 +0200

handle docx's w:anchor layoutInCell attribute (bnc#891663)

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

diff --git a/sw/qa/extras/ooxmlimport/data/bnc891663.docx 
b/sw/qa/extras/ooxmlimport/data/bnc891663.docx
new file mode 100644
index 000..d5f057e
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/bnc891663.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 305b6ed..07761dd 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2275,6 +2275,15 @@ DECLARE_OOXMLIMPORT_TEST(testBnc519228OddBreaks, 
bnc519228_odd-breaks.docx)
 getParagraphOfText( 1, getProperty uno::Referencetext::XText 
(page5Style, HeaderText), This is the header for odd pages);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testBnc891663, bnc891663.docx)
+{
+// The image should be inside a cell, so the text in the following cell 
should be below it.
+int imageTop = 
parseDump(/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds,
 top).toInt32();
+int imageHeight = 
parseDump(/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds,
 height).toInt32();
+int textNextRowTop = 
parseDump(/root/page/body/tab/row[2]/cell[1]/txt[1]/infos/bounds, 
top).toInt32();
+CPPUNIT_ASSERT( textNextRowTop = imageTop + imageHeight );
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx 
b/writerfilter/source/dmapper/GraphicImport.cxx
index 6cd88a5..4c68904 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -210,6 +210,7 @@ public:
 sal_Int16 nVertOrient;
 sal_Int16 nVertRelation;
 sal_Int32 nWrap;
+bool  bLayoutInCell;
 bool  bOpaque;
 bool  bContour;
 bool  bContourOutside;
@@ -283,6 +284,7 @@ public:
 ,nVertOrient(  text::VertOrientation::NONE )
 ,nVertRelation( text::RelOrientation::FRAME )
 ,nWrap(0)
+,bLayoutInCell(false)
 ,bOpaque( true )
 ,bContour(false)
 ,bContourOutside(true)
@@ -580,7 +582,10 @@ void GraphicImport::lcl_attribute(Id nName, Value rValue)
 m_pImpl-bOpaque = false;
 break;
 case NS_ooxml::LN_CT_Anchor_locked: // 90990; - ignored
+break;
 case NS_ooxml::LN_CT_Anchor_layoutInCell: // 90991; - ignored
+m_pImpl-bLayoutInCell = nIntValue != 0;
+break;
 case NS_ooxml::LN_CT_Anchor_hidden: // 90992; - ignored
 break;
 case NS_ooxml::LN_CT_Anchor_allowOverlap: // 90993;
@@ -1230,6 +1235,9 @@ uno::Reference text::XTextContent  
GraphicImport::createGraphicObject( const b
 }
 
xGraphicObjectProperties-setPropertyValue(rPropNameSupplier.GetName( 
PROP_SURROUND ),
 uno::makeAny(m_pImpl-nWrap));
+if( m_pImpl-bLayoutInCell  m_pImpl-nWrap != 
text::WrapTextMode_THROUGHT )
+
xGraphicObjectProperties-setPropertyValue(rPropNameSupplier.GetName( 
PROP_FOLLOW_TEXT_FLOW ),
+uno::makeAny(true));
 
 
xGraphicObjectProperties-setPropertyValue(rPropNameSupplier.GetName( 
PROP_SURROUND_CONTOUR ),
 uno::makeAny(m_pImpl-bContour));
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx 
b/writerfilter/source/dmapper/PropertyIds.cxx
index 3f5fa05..fc81dae 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -394,6 +394,7 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) 
const
 case PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING : sName = 
ApplyParagraphMarkFormatToNumbering; break;
 case PROP_CELL_DIRECTION: sName = CellDirection; break;
 case PROP_CELL_HIDE_MARK: sName = CellHideMark; break;
+case PROP_FOLLOW_TEXT_FLOW: sName = IsFollowingTextFlow; break;
 }
 ::std::pairPropertyNameMap_t::iterator,bool aInsertIt =
 m_pImpl-aNameMap.insert( PropertyNameMap_t::value_type( eId, 
sName ));
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx 
b/writerfilter/source/dmapper/PropertyIds.hxx
index 3510e62..7394a50 100644
--- 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-09-23 Thread Luboš Luňák
 sw/qa/extras/ooxmlimport/data/bnc891663.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |9 +
 writerfilter/source/dmapper/GraphicImport.cxx |7 +++
 writerfilter/source/dmapper/PropertyIds.cxx   |1 +
 writerfilter/source/dmapper/PropertyIds.hxx   |1 +
 5 files changed, 18 insertions(+)

New commits:
commit 2a632bb30f78f02042ce333d426468087639305b
Author: Luboš Luňák l.lu...@collabora.com
Date:   Sun Sep 21 17:52:58 2014 +0200

handle docx's w:anchor layoutInCell attribute (bnc#891663)

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

diff --git a/sw/qa/extras/ooxmlimport/data/bnc891663.docx 
b/sw/qa/extras/ooxmlimport/data/bnc891663.docx
new file mode 100644
index 000..d5f057e
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/bnc891663.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 305b6ed..07761dd 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2275,6 +2275,15 @@ DECLARE_OOXMLIMPORT_TEST(testBnc519228OddBreaks, 
bnc519228_odd-breaks.docx)
 getParagraphOfText( 1, getProperty uno::Referencetext::XText 
(page5Style, HeaderText), This is the header for odd pages);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testBnc891663, bnc891663.docx)
+{
+// The image should be inside a cell, so the text in the following cell 
should be below it.
+int imageTop = 
parseDump(/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds,
 top).toInt32();
+int imageHeight = 
parseDump(/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds,
 height).toInt32();
+int textNextRowTop = 
parseDump(/root/page/body/tab/row[2]/cell[1]/txt[1]/infos/bounds, 
top).toInt32();
+CPPUNIT_ASSERT( textNextRowTop = imageTop + imageHeight );
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx 
b/writerfilter/source/dmapper/GraphicImport.cxx
index 6cd88a5..e2d3fa3 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -210,6 +210,7 @@ public:
 sal_Int16 nVertOrient;
 sal_Int16 nVertRelation;
 sal_Int32 nWrap;
+bool  bLayoutInCell;
 bool  bOpaque;
 bool  bContour;
 bool  bContourOutside;
@@ -283,6 +284,7 @@ public:
 ,nVertOrient(  text::VertOrientation::NONE )
 ,nVertRelation( text::RelOrientation::FRAME )
 ,nWrap(0)
+,bLayoutInCell(false)
 ,bOpaque( true )
 ,bContour(false)
 ,bContourOutside(true)
@@ -581,6 +583,8 @@ void GraphicImport::lcl_attribute(Id nName, Value rValue)
 break;
 case NS_ooxml::LN_CT_Anchor_locked: // 90990; - ignored
 case NS_ooxml::LN_CT_Anchor_layoutInCell: // 90991; - ignored
+m_pImpl-bLayoutInCell = nIntValue != 0;
+break;
 case NS_ooxml::LN_CT_Anchor_hidden: // 90992; - ignored
 break;
 case NS_ooxml::LN_CT_Anchor_allowOverlap: // 90993;
@@ -1230,6 +1234,9 @@ uno::Reference text::XTextContent  
GraphicImport::createGraphicObject( const b
 }
 
xGraphicObjectProperties-setPropertyValue(rPropNameSupplier.GetName( 
PROP_SURROUND ),
 uno::makeAny(m_pImpl-nWrap));
+if( m_pImpl-bLayoutInCell  m_pImpl-nWrap != 
text::WrapTextMode_THROUGHT )
+
xGraphicObjectProperties-setPropertyValue(rPropNameSupplier.GetName( 
PROP_FOLLOW_TEXT_FLOW ),
+uno::makeAny(true));
 
 
xGraphicObjectProperties-setPropertyValue(rPropNameSupplier.GetName( 
PROP_SURROUND_CONTOUR ),
 uno::makeAny(m_pImpl-bContour));
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx 
b/writerfilter/source/dmapper/PropertyIds.cxx
index 3f5fa05..fc81dae 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -394,6 +394,7 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) 
const
 case PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING : sName = 
ApplyParagraphMarkFormatToNumbering; break;
 case PROP_CELL_DIRECTION: sName = CellDirection; break;
 case PROP_CELL_HIDE_MARK: sName = CellHideMark; break;
+case PROP_FOLLOW_TEXT_FLOW: sName = IsFollowingTextFlow; break;
 }
 ::std::pairPropertyNameMap_t::iterator,bool aInsertIt =
 m_pImpl-aNameMap.insert( PropertyNameMap_t::value_type( eId, 
sName ));
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx 
b/writerfilter/source/dmapper/PropertyIds.hxx
index 3510e62..7394a50 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-09-23 Thread Andras Timar
 dev/null  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |9 -
 writerfilter/source/dmapper/GraphicImport.cxx |7 ---
 writerfilter/source/dmapper/PropertyIds.cxx   |1 -
 writerfilter/source/dmapper/PropertyIds.hxx   |1 -
 5 files changed, 18 deletions(-)

New commits:
commit b3db68f6d26b5eee54c3f636a71ad22ff207965e
Author: Andras Timar andras.ti...@collabora.com
Date:   Tue Sep 23 23:40:56 2014 +0200

Revert handle docx's w:anchor layoutInCell attribute (bnc#891663)

This reverts commit 2a632bb30f78f02042ce333d426468087639305b.

diff --git a/sw/qa/extras/ooxmlimport/data/bnc891663.docx 
b/sw/qa/extras/ooxmlimport/data/bnc891663.docx
deleted file mode 100644
index d5f057e..000
Binary files a/sw/qa/extras/ooxmlimport/data/bnc891663.docx and /dev/null differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 07761dd..305b6ed 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2275,15 +2275,6 @@ DECLARE_OOXMLIMPORT_TEST(testBnc519228OddBreaks, 
bnc519228_odd-breaks.docx)
 getParagraphOfText( 1, getProperty uno::Referencetext::XText 
(page5Style, HeaderText), This is the header for odd pages);
 }
 
-DECLARE_OOXMLIMPORT_TEST(testBnc891663, bnc891663.docx)
-{
-// The image should be inside a cell, so the text in the following cell 
should be below it.
-int imageTop = 
parseDump(/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds,
 top).toInt32();
-int imageHeight = 
parseDump(/root/page/body/tab/row[1]/cell[2]/txt[1]/anchored/fly/infos/bounds,
 height).toInt32();
-int textNextRowTop = 
parseDump(/root/page/body/tab/row[2]/cell[1]/txt[1]/infos/bounds, 
top).toInt32();
-CPPUNIT_ASSERT( textNextRowTop = imageTop + imageHeight );
-}
-
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx 
b/writerfilter/source/dmapper/GraphicImport.cxx
index e2d3fa3..6cd88a5 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -210,7 +210,6 @@ public:
 sal_Int16 nVertOrient;
 sal_Int16 nVertRelation;
 sal_Int32 nWrap;
-bool  bLayoutInCell;
 bool  bOpaque;
 bool  bContour;
 bool  bContourOutside;
@@ -284,7 +283,6 @@ public:
 ,nVertOrient(  text::VertOrientation::NONE )
 ,nVertRelation( text::RelOrientation::FRAME )
 ,nWrap(0)
-,bLayoutInCell(false)
 ,bOpaque( true )
 ,bContour(false)
 ,bContourOutside(true)
@@ -583,8 +581,6 @@ void GraphicImport::lcl_attribute(Id nName, Value rValue)
 break;
 case NS_ooxml::LN_CT_Anchor_locked: // 90990; - ignored
 case NS_ooxml::LN_CT_Anchor_layoutInCell: // 90991; - ignored
-m_pImpl-bLayoutInCell = nIntValue != 0;
-break;
 case NS_ooxml::LN_CT_Anchor_hidden: // 90992; - ignored
 break;
 case NS_ooxml::LN_CT_Anchor_allowOverlap: // 90993;
@@ -1234,9 +1230,6 @@ uno::Reference text::XTextContent  
GraphicImport::createGraphicObject( const b
 }
 
xGraphicObjectProperties-setPropertyValue(rPropNameSupplier.GetName( 
PROP_SURROUND ),
 uno::makeAny(m_pImpl-nWrap));
-if( m_pImpl-bLayoutInCell  m_pImpl-nWrap != 
text::WrapTextMode_THROUGHT )
-
xGraphicObjectProperties-setPropertyValue(rPropNameSupplier.GetName( 
PROP_FOLLOW_TEXT_FLOW ),
-uno::makeAny(true));
 
 
xGraphicObjectProperties-setPropertyValue(rPropNameSupplier.GetName( 
PROP_SURROUND_CONTOUR ),
 uno::makeAny(m_pImpl-bContour));
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx 
b/writerfilter/source/dmapper/PropertyIds.cxx
index fc81dae..3f5fa05 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -394,7 +394,6 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) 
const
 case PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING : sName = 
ApplyParagraphMarkFormatToNumbering; break;
 case PROP_CELL_DIRECTION: sName = CellDirection; break;
 case PROP_CELL_HIDE_MARK: sName = CellHideMark; break;
-case PROP_FOLLOW_TEXT_FLOW: sName = IsFollowingTextFlow; break;
 }
 ::std::pairPropertyNameMap_t::iterator,bool aInsertIt =
 m_pImpl-aNameMap.insert( PropertyNameMap_t::value_type( eId, 
sName ));
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx 
b/writerfilter/source/dmapper/PropertyIds.hxx
index 7394a50..3510e62 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -366,7 +366,6 @@ enum PropertyIds
 ,PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING
 ,PROP_CELL_DIRECTION
 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-09-05 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/picture-wrap-polygon.rtf |   47 +++
 sw/qa/extras/rtfimport/rtfimport.cxx |8 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx   |4 -
 3 files changed, 57 insertions(+), 2 deletions(-)

New commits:
commit ec8c747b457c2b1161b875474d2ba4e15819a3c7
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Aug 16 17:53:34 2014 +0200

fdo#82067 RTF import: handle negative SHPLEFT / SHPTOP

(cherry picked from commit dc0149869bc0cc09e92816ae6f34831bf5353e3b)

Change-Id: Id82d6d54b160b5b78a53c526e6ccab0514c21312
Reviewed-on: https://gerrit.libreoffice.org/11283
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/picture-wrap-polygon.rtf 
b/sw/qa/extras/rtfimport/data/picture-wrap-polygon.rtf
new file mode 100644
index 000..4fec72f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/picture-wrap-polygon.rtf
@@ -0,0 +1,47 @@
+{\rtf1\pard\plain
+{\shp
+{\*\shpinst\shpleft-1177\shptop-67\shpright1613\shpbottom2723\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr4\shpwrk0\shpfblwtxt1\shpz0\shplid1026
+{\sp{\sn shapeType}{\sv 75}}
+{\sp
+{\sn pib}
+{\sv
+{\pict\picscalex218\picscaley218\piccropl0\piccropr0\piccropt0\piccropb0
+\picw2258\pich2258\picwgoal1280\pichgoal1280\pngblip\bliptag1974568719
+89504e470d0a1a0a000d4948445200400040080600aa6971de000473424954080808087c0864880009704859730b120b
+1201d2dd7efc001874455874536f6674776172650041646f62652046697265776f726b734fb31f4e059049444154789ced9bdd8bd45518c73fcff9bd
+ccecbc38abbbea14b551a94890a4d04579515646d44d4160443782418410485df50f14417411dde47528845117929ba85d488808dbcb85a5bdd9a6bbae2f3bed
+b8cefce6f73b4f1733b3ad26eeac737676dcf10be7665ece79ce73bee77b9ee739bf9fa82a4dbcfe4da918faec0a3dd966842161694001ab9c8912dd1bc57cf8
+e9d6c258f33b693ae0cd43a56db994ec2ea44d2e1b0a812798c5b2d8312c504b942b9152aad872b9aa3b3e79aab0171a0ed879b8b46d2063f60c663d72a1107a
+82b75466df4062214a9472a45cb8927071dabef2f196c25e79e3e0647155ce9c2ae6bd5c3e6596dcc4af476261aa6a199b4acae7cb76ad9f4bc9ae155993cba5
+0463149dbb8fdb1ac6402e25acb026375dd39dfeb2b4bc940d0423a04b7df60d18816c202c4bc94b7e5f60867c4fb08b6d5587e179423a9435beef118a61c953
+ff7a18038127a12f8dc3bed71c0020023eda3b7bff7f50f02df4dcfe6fc202bea2688f5240517ca537f73fd4e77d670bdc1141dc3240808dcb03d6e43d065286
+52a4fc5a8e397eb1d6754cab8ba04306580b2fde9be29eac37f359211436ad0818ca78ecfbab4adc4574d3ff18d0be5156e1e14270cde46763306dd8b4dce3e8
+855ad7649c1630cd53a0dd564b944756f8371df0a1fe80285127e3b96abe6a7df5da4535864278f3a5cdf8825a71329e0bccda02ed23d67a9a39172c8aa53baa
+8d4e45b0d5556d32ae1b5cd060803a6140abb5a4e678dde0008bbad38056fb7877437ede7d8f5db57c3f5963e4720d71e839a71ab090414eb1cf50ec4b715fc6
+63df6805e3e81875aa019d886fd6177cd6977c4e4ec54e98a00aa6c980765ba74eb647070222ab4e6c9ea907b8d180ceb8a03f3444b13a892615bd3d3460362e
+572d89bab3d95d32d4a13d7062a2561fce916edd560c385d8a393c1e91ed73cc804ec601b782f169cbd1b18803a315b219831137f984d348b0d5947afba149aa
+f3b05e043c03e940c8648430001537779816c5b78e18d06a17858c901899d7396e1a4ef03d0171c736abd4abc29dd4003f1082e0d67201d715ec997a40272341
+e37005dbc5a29c02abd31e7f4789d3a4e6566101dfaa9b485055998e958c7ff3993d3618b06734ee8abaa055add7045de502172a73f3e0f155211bfb8399686e
+319b530d00f86d2a612877e3aaf06c6c7f20c3ba8988e3976b8c4e27448b542a77aa011818b954e3c9bbc2967ebe7965c8e695adfd76ac623971a9c6f07885a4
+1d1baf435d0370a4ca22fc3819538a9442e856e18a69c30b77a7589ff7f8e8f4348923c634ee05b451a76baf214a622c5ffe79d5897137c283799fa7570624ea
+c66645314d0d68b741fdc1a3e17355fe987249d46bb1b13f2449dcd8ecb422640131600278ff87294ad1c2e4878550a839ac0899662ee0a229751694acf2de48
+99a99a7b751f9fb658ebce66677783cd26068250f8bd92f0f6b17f182dbbdd0e87ce55415cde0d3a4a8767433c0852301925bc756c92678a695e5b97211fb477
+3a1c395be5c844953025b8b8d1d6e6c5c842c421c640180ac6c0c1f35586cf56d8b03c64f3ea90fb9779e403433133773c1c5b383919b3ff4c85ef2e45f4a5eb
+a974d795c46e08035e20a43c4812f8e94a8d915f6a58aba86d28f11c5dd40b22f5143a95168c0f2a6ed262b745d19bc0183046f03c080250ad2f61abc38ad4ff
+3bf354ab237b179e01d7c330eb5a6bfe7ad0142e57b080dfecb857d1d802bde982ce6f812e43c744b05ba1ca9d67857d8548a1b5cac4128342e45be58c55d62c
+b6318b01abfc6cacd52f9a995c2f35ab60ad7e25cf0e4f14c33e39653c726efc7a7bc02694ab5775ad39b075702c8ed9d14b2cb00a71cc8ee1ad8363332f4f3f
+ffedc5573d9fdd22f4397171974295ab49cc8efd4f0c7c06b3de1e0778eef0c5a2e7f38e185e166168d1ac5c00a872462d9f27311f7cbd6560e6f5f97f01f618b11f3ea2336949454e44ae426082}
+}
+}
+{\sp
+{\sn pWrapPolygonVertices}
+{\sv 
8;11;(7781,4181);(5923,4994);(5458,14284);(7200,16839);(15445,16490);(15678,13355);(15910,11497);(16026,7432);(12078,6271);(10219,5110);(7781,4181)}
+}
+{\sp
+{\sn fBehindDocument}
+{\sv 1}
+}
+}
+}
+Suddenly next to him, with a barely noticeable squeak, a door swung quietly to 
and fro in the night's breeze. Could this be the haven he'd prayed for? Slowly 
he slid toward the door, 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-08-26 Thread Miklos Vajna
 sw/qa/core/data/ooxml/pass/liststyle-gridbefore.docx |binary
 writerfilter/source/dmapper/StyleSheetTable.cxx  |3 ++-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a0d22fdafd0e8f89196b7203afe9933811b92ea1
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Aug 22 13:51:54 2014 +0200

DOCX import: list styles don't support automatic updates

The problem was the following: setPropertyValue(IsAutoUpdate) on the
style failed - a number of styles was not imported in
StyleSheetTable::ApplyStyleSheets() due to the exception, then when we
tried to use one of the not imported styles, we also got an exception in
DomainMapper_Impl::finishParagraph(), which resulted in not calling
DomainMapperTableManager::handle(), so multiple cells of the same table
wanted the same range for cell contents, and that resulted in a crash.

Regression from cf33af732ed0d3d553bb74636e3b14c55d44c153 (handle
w:gridBefore by faking cells (fdo#38414), 2014-04-23), but that commit
just made the previously hidden problem visible.

(cherry picked from commit 7c02c7b0216f642074b690cce889f1a02a2ef6b0)

Change-Id: I788cb6b4a2c7b7efbfa48297c658bb26450bf583
Reviewed-on: https://gerrit.libreoffice.org/11068
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/core/data/ooxml/pass/liststyle-gridbefore.docx 
b/sw/qa/core/data/ooxml/pass/liststyle-gridbefore.docx
new file mode 100644
index 000..60dae2a
Binary files /dev/null and 
b/sw/qa/core/data/ooxml/pass/liststyle-gridbefore.docx differ
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 9e76b14..3442d1a3 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1161,7 +1161,8 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr 
rFontTable )
 xPropertySet-setPropertyValue(StyleInteropGrabBag, 
uno::makeAny(aGrabBag));
 }
 
-if (pEntry-bAutoRedefine)
+// List styles don't support automatic update.
+if (pEntry-bAutoRedefine  !bListStyle)
 xPropertySet-setPropertyValue(IsAutoUpdate, 
uno::makeAny(sal_True));
 }
 else if(pEntry-nStyleTypeCode == STYLE_TYPE_TABLE)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-08-22 Thread Luboš Luňák
 sw/qa/extras/ooxmlimport/data/bnc519228_odd-breaks.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx|   31 ++
 writerfilter/source/dmapper/PropertyMap.cxx |  180 +---
 writerfilter/source/dmapper/PropertyMap.hxx |2 
 4 files changed, 138 insertions(+), 75 deletions(-)

New commits:
commit 3680f2d74964c38f153fd26a09d773a0592a1aa6
Author: Luboš Luňák l.lu...@collabora.com
Date:   Sun Aug 17 21:35:48 2014 +0200

fix reading even/odd page breaks from .docx (bnc#519228)

We map Word's even/odd page breaks to Writer's left/right page styles. And 
we cannot
just set any page style to be left/right, because that could set e.g. the 
default
page style as such, which would make all normal pages that way. So instead 
we need
to make a copy of the relevant page style, as the original page style as 
its follow,
copy all the properties and headers/footers, and use this copy to get the 
page break.

(cherry picked from commit b32881b6723072c8d1a652ea147d12e75766d504)

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

Change-Id: Id0d2568de91ac2de4afb0ba3a6eedd9cec46f878
Reviewed-on: https://gerrit.libreoffice.org/11025
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/ooxmlimport/data/bnc519228_odd-breaks.docx 
b/sw/qa/extras/ooxmlimport/data/bnc519228_odd-breaks.docx
new file mode 100644
index 000..8711d62
Binary files /dev/null and 
b/sw/qa/extras/ooxmlimport/data/bnc519228_odd-breaks.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index fb82c8f..9dab8ea 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -52,6 +52,7 @@
 #include com/sun/star/xml/dom/XDocument.hpp
 #include com/sun/star/text/XDocumentIndex.hpp
 #include com/sun/star/style/CaseMap.hpp
+#include com/sun/star/style/PageStyleLayout.hpp
 #include com/sun/star/style/ParagraphAdjust.hpp
 #include vcl/svapp.hxx
 #include unotools/fltrcfg.hxx
@@ -2233,6 +2234,36 @@ DECLARE_OOXMLIMPORT_TEST(testHidemark, hidemark.docx)
 CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, 
getPropertysal_Int16(xTableRows-getByIndex(1), SizeType));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testBnc519228OddBreaks, bnc519228_odd-breaks.docx)
+{
+// Check that all the normal styles are not set as right-only, those 
should be only those used after odd page breaks.
+uno::Referencebeans::XPropertySet 
defaultStyle(getStyles(PageStyles)-getByName(DEFAULT_STYLE), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_ALL), 
defaultStyle-getPropertyValue(PageStyleLayout));
+uno::Referencebeans::XPropertySet firstPage( 
getStyles(PageStyles)-getByName(First Page), uno::UNO_QUERY );
+CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_ALL), 
firstPage-getPropertyValue(PageStyleLayout));
+
+OUString page1StyleName = getPropertyOUString( getParagraph( 1, This is 
the first page. ), PageDescName);
+uno::Referencebeans::XPropertySet 
page1Style(getStyles(PageStyles)-getByName(page1StyleName), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_RIGHT), 
page1Style-getPropertyValue(PageStyleLayout));
+getParagraphOfText( 1, getProperty uno::Referencetext::XText 
(page1Style, HeaderText), This is the header for odd pages);
+
+// Page2 comes from follow of style for page 1 and should be a normal 
page. Also check the two page style have the same properties,
+// since page style for page1 was created from page style for page 2.
+OUString page2StyleName = getPropertyOUString( getParagraph( 3, This is 
page 2, which is obviously an even page. ), PageDescName);
+CPPUNIT_ASSERT_EQUAL(OUString(), page2StyleName);
+page2StyleName = getPropertyOUString( page1Style, FollowStyle );
+uno::Referencebeans::XPropertySet 
page2Style(getStyles(PageStyles)-getByName(page2StyleName), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_ALL), 
page2Style-getPropertyValue(PageStyleLayout));
+getParagraphOfText( 1, getProperty uno::Referencetext::XText 
(page2Style, HeaderTextLeft), This is the even header);
+getParagraphOfText( 1, getProperty uno::Referencetext::XText 
(page2Style, HeaderTextRight), This is the header for odd pages);
+CPPUNIT_ASSERT_EQUAL(getPropertysal_Int32(page1Style, TopMargin), 
getPropertysal_Int32(page2Style, TopMargin));
+
+OUString page5StyleName = getPropertyOUString( getParagraph( 5, Then an 
odd break after an odd page, should lead us to page #5. ), PageDescName);
+uno::Referencebeans::XPropertySet 
page5Style(getStyles(PageStyles)-getByName(page5StyleName), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(uno::makeAny(style::PageStyleLayout_RIGHT), 
page5Style-getPropertyValue(PageStyleLayout));
+getParagraphOfText( 1, getProperty 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa

2014-08-21 Thread Luboš Luňák
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8a6a1e8ba291302c44067cd5c40063f9d76ee48c
Author: Luboš Luňák l.lu...@collabora.com
Date:   Thu Aug 21 18:18:28 2014 +0200

fix(?) windows build

Change-Id: Idc57210f23f1a053fc21d47e85206f55704c5880

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index fdcab8a..5590246 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3628,8 +3628,6 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80898, fdo80898.docx)
 /word/embeddings/oleObject1.doc);
 }
 
-#endif
-
 DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooter, first-header-footer.docx)
 {
 // Test import and export of a section's headerf/footerf properties.
@@ -3658,6 +3656,8 @@ DECLARE_OOXMLEXPORT_TEST(testFooterBodyDistance, 
footer-body-distance.docx)
 assertXPath(pXmlDoc, /w:document/w:body/w:p/w:r/w:br, 1);
 }
 
+#endif
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-08-18 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/hidemark.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |   13 
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   48 +++
 writerfilter/source/dmapper/PropertyIds.cxx  |1 
 writerfilter/source/dmapper/PropertyIds.hxx  |1 
 writerfilter/source/dmapper/TablePropertiesHandler.cxx   |8 ++
 6 files changed, 71 insertions(+)

New commits:
commit eff81a79fa09ce17ba77319b01e8a91a805a42c0
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Aug 14 13:54:18 2014 +0200

bnc#865381 DOCX import: handle w:hideMark table cell property

(cherry picked from commit d1278ef4849661b9ae0eb7aaf4d74fbf91ccaf11)

Conflicts:
writerfilter/source/dmapper/PropertyIds.cxx
writerfilter/source/dmapper/PropertyIds.hxx

Change-Id: Id0dd34110376168e34df4956869608895b86abfe
Reviewed-on: https://gerrit.libreoffice.org/10922
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/extras/ooxmlimport/data/hidemark.docx 
b/sw/qa/extras/ooxmlimport/data/hidemark.docx
new file mode 100644
index 000..4a273d6
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/hidemark.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 1dc6161..fb82c8f 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2220,6 +2220,19 @@ 
DECLARE_OOXMLIMPORT_TEST(testFloatingTableSectionColumns, floating-table-sectio
 CPPUNIT_ASSERT( tableWidth.toInt32()  1 );
 }
 
+DECLARE_OOXMLIMPORT_TEST(testHidemark, hidemark.docx)
+{
+// Problem was that w:hideMark cell property was ignored.
+uno::Referencetext::XTextTablesSupplier xTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xTables(xTablesSupplier-getTextTables( ), uno::UNO_QUERY);
+uno::Referencetext::XTextTable xTextTable(xTables-getByIndex(0), 
uno::UNO_QUERY);
+uno::Referencetable::XTableRows xTableRows(xTextTable-getRows(), 
uno::UNO_QUERY);
+// Height should be minimal
+CPPUNIT_ASSERT_EQUAL(convertTwipToMm100(MINLAY), 
getPropertysal_Int64(xTableRows-getByIndex(1), Height));
+// Size type was MIN, should be FIX to avoid considering the end of 
paragraph marker.
+CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, 
getPropertysal_Int16(xTableRows-getByIndex(1), SizeType));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index a8650a5..33f70cc 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -29,9 +29,11 @@
 #include com/sun/star/text/RelOrientation.hpp
 #include com/sun/star/text/SizeType.hpp
 #include com/sun/star/text/VertOrientation.hpp
+#include com/sun/star/text/XTextRangeCompare.hpp
 #include com/sun/star/style/ParagraphAdjust.hpp
 #include dmapperLoggers.hxx
 #include TablePositionHandler.hxx
+#include ConversionHelper.hxx
 
 #ifdef DEBUG_DMAPPER_TABLE_HANDLER
 #include PropertyMapHelper.hxx
@@ -886,12 +888,50 @@ CellPropertyValuesSeq_t 
DomainMapperTableHandler::endTableGetCellProperties(Tabl
 return aCellProperties;
 }
 
+/// Do all cells in this row have a CellHideMark property?
+bool lcl_hideMarks(PropertyMapVector1 rCellProperties)
+{
+for (size_t nCell = 0; nCell  rCellProperties.size(); ++nCell)
+if (rCellProperties[nCell]-find(PROP_CELL_HIDE_MARK) == 
rCellProperties[nCell]-end())
+return false;
+return true;
+}
+
+/// Are all cells in this row empty?
+bool lcl_emptyRow(TableSequence_t rTableSeq, sal_Int32 nRow)
+{
+if (nRow = rTableSeq.getLength())
+{
+SAL_WARN(writerfilter, m_aCellProperties not in sync with 
m_pTableSeq?);
+return false;
+}
+
+RowSequence_t rRowSeq = rTableSeq[nRow];
+uno::Referencetext::XTextRangeCompare 
xTextRangeCompare(rRowSeq[0][0]-getText(), uno::UNO_QUERY);
+try
+{
+for (sal_Int32 nCell = 0; nCell  rRowSeq.getLength(); ++nCell)
+// See SwXText::Impl::ConvertCell(), we need to compare the start 
of
+// the start and the end of the end. However for our text ranges, 
only
+// the starts are set, so compareRegionStarts() does what we need.
+if (xTextRangeCompare-compareRegionStarts(rRowSeq[nCell][0], 
rRowSeq[nCell][1]) != 0)
+return false;
+}
+catch (lang::IllegalArgumentException e)
+{
+SAL_WARN(writerfilter, compareRegionStarts() failed:   
e.Message);
+return false;
+}
+return true;
+}
+
 RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties()
 {
 #ifdef DEBUG_DMAPPER_TABLE_HANDLER
 dmapper_logger-startElement(getRowProperties);
 #endif
 
+  

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-08-18 Thread Luboš Luňák
 sw/qa/extras/ww8import/data/bnc787942.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx  |6 ++
 sw/source/filter/ww8/ww8par.hxx   |2 ++
 sw/source/filter/ww8/ww8par6.cxx  |   14 +-
 4 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 8d7354156aa4fe672766d5dba364037b66cb3435
Author: Luboš Luňák l.lu...@collabora.com
Date:   Sun Aug 17 18:12:16 2014 +0200

fix reading a .doc that has frame anchored to the end of page (bnc#787942)

MSWord, unlike Writer, can anchor even to a page break (i.e. after the last
paragraph). When this document was read, what happended was:
- the last paragraph was read and the current position PaM was set to point
  after it
- frame was read and anchored to the PaM
- page break was read, making everything following be moved to the next 
page;
  including whatever ended up at the PaM position
Handle this by checking for this case and inserting an extra empty paragraph
before the break. This shouldn't affect layout of the page itself anyway,
since the break should leave room for it (and MSWord shows a page break
there if control characters are enabled, so there is room).

(cherry picked from commit 4a1888a97eab4ead2e0bec76cd1cba410a8e7e13)

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

Change-Id: Ia2a13bf5cf1c959b5aa228254365019a00a22679
Reviewed-on: https://gerrit.libreoffice.org/10951
Reviewed-by: Matúš Kukan matus.ku...@collabora.com
Tested-by: Matúš Kukan matus.ku...@collabora.com

diff --git a/sw/qa/extras/ww8import/data/bnc787942.doc 
b/sw/qa/extras/ww8import/data/bnc787942.doc
new file mode 100644
index 000..06b2c39
Binary files /dev/null and b/sw/qa/extras/ww8import/data/bnc787942.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 33e0cfb..81b0043 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -490,6 +490,12 @@ DECLARE_WW8IMPORT_TEST(testFloatingTableSectionColumns, 
floating-table-section-
 CPPUNIT_ASSERT( tableWidth.toInt32()  1 );
 }
 
+DECLARE_WW8IMPORT_TEST(testBnc787942, bnc787942.doc)
+{
+// The frame ended up on the second page instead of first.
+parseDump(/root/page[1]/body/txt[4]/anchored);
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 99b5de2..0acfdb8 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1345,6 +1345,8 @@ private:
 // a document position recorded the after-position of TOC section, managed 
by Read_F_TOX() and End_Field()
 SwPaM* mpPosAfterTOC;
 
+boost::scoped_ptr SwPosition  lastAnchorPos;
+
 bool mbCareFirstParaEndInToc;
 bool mbCareLastParaEndInToc;
 cp_set maTOXEndCps;
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 6942f88..5e7ce09 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -794,6 +794,18 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool 
/*bMustHaveBreak*/)
 if (!pSep)
 return;
 
+if (!maSegments.empty()  mrReader.lastAnchorPos.get()  
*mrReader.lastAnchorPos == *mrReader.pPaM-GetPoint())
+{
+bool insert = true;
+SwPaM pam( *mrReader.lastAnchorPos );
+if( pam.Move(fnMoveBackward, fnGoNode))
+if( SwTxtNode* txtNode = 
pam.GetPoint()-nNode.GetNode().GetTxtNode())
+if( txtNode-Len() == 0 )
+insert = false;
+if( insert )
+mrReader.AppendTxtNode(*mrReader.pPaM-GetPoint());
+}
+
 ww::WordVersion eVer = mrReader.GetFib().GetFIBVersion();
 
 // M.M. Create a linked section if the WkbPLCF
@@ -1735,7 +1747,6 @@ WW8SwFlyPara::WW8SwFlyPara( SwPaM rPaM,
 const sal_Int32 nIniFlyDx,
 const sal_Int32 nIniFlyDy )
 {
-(void) rPaM;
 (void) nPgLeft;
 
 memset( this, 0, sizeof( WW8SwFlyPara ) );  // Initialisieren
@@ -1803,6 +1814,7 @@ WW8SwFlyPara::WW8SwFlyPara( SwPaM rPaM,
 //#i53725# - absolute positioned objects have to be
 // anchored at-paragraph to assure its correct anchor position.
 eAnchor = FLY_AT_PARA;
+rIo.lastAnchorPos.reset( new SwPosition(*rPaM.GetPoint()));
 
 switch (nYBind)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa xmloff/source

2014-08-14 Thread Michael Stahl
 sw/qa/extras/odfimport/data/fdo82165.odt  |binary
 sw/qa/extras/odfimport/odfimport.cxx  |   10 ++
 xmloff/source/text/XMLTextHeaderFooterContext.cxx |   13 +++--
 3 files changed, 21 insertions(+), 2 deletions(-)

New commits:
commit fe7d0f8b60c7a99d150b32eb5530a4a530267fab
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 12 17:47:20 2014 +0200

fdo#82165: ODF import: clear all shapes when removing header content

Shapes anchored to the first or last paragraph survive setString()
so need to be deleted with some ruse.

(regression from b8499fc3dcf474050f026b8d5cd1d9037bbe42b7)

Change-Id: I00a8132583c45d1953c207932cc7f02f3065ae77
(cherry picked from commit 555c988f3b896e16afc7bdd1bd98e48229599637)
Reviewed-on: https://gerrit.libreoffice.org/10894
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/extras/odfimport/data/fdo82165.odt 
b/sw/qa/extras/odfimport/data/fdo82165.odt
new file mode 100644
index 000..65a4084
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo82165.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx 
b/sw/qa/extras/odfimport/odfimport.cxx
index 299fea7..8cd4b09 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -345,6 +345,16 @@ DECLARE_ODFIMPORT_TEST(testFdo68839, fdo68839.odt)
 getPropertyOUString(xFrame2, ChainNextName));
 }
 
+DECLARE_ODFIMPORT_TEST(testFdo82165, fdo82165.odt)
+{
+// there was a duplicate shape in the left header
+lcl_CheckShape(getShape(1), Picture 9);
+try {
+uno::Referencedrawing::XShape xShape = getShape(2);
+CPPUNIT_FAIL(IndexOutOfBoundsException expected);
+} catch (lang::IndexOutOfBoundsException const) { }
+}
+
 DECLARE_ODFIMPORT_TEST(testFdo37606, fdo37606.odt)
 {
 SwXTextDocument* pTxtDoc = dynamic_castSwXTextDocument 
*(mxComponent.get());
diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx 
b/xmloff/source/text/XMLTextHeaderFooterContext.cxx
index ca59d82..fd727e9 100644
--- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx
+++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx
@@ -18,6 +18,7 @@
  */
 
 #include com/sun/star/text/XText.hpp
+#include com/sun/star/text/XParagraphAppend.hpp
 #include com/sun/star/text/XRelativeTextContentRemove.hpp
 #include xmloff/nmspmap.hxx
 #include xmloff/xmlnmspe.hxx
@@ -158,8 +159,16 @@ SvXMLImportContext 
*XMLTextHeaderFooterContext::CreateChildContext(
 
 if( bRemoveContent )
 {
-OUString aText;
-xText-setString( aText );
+xText-setString(OUString());
+// fdo#82165 shapes anchored at the beginning or end survive
+// setString() - kill them the hard way: SwDoc::DelFullPara()
+uno::Referencetext::XParagraphAppend const xAppend(
+xText, uno::UNO_QUERY_THROW);
+uno::Referencelang::XComponent const xPara(
+xAppend-finishParagraph(
+uno::Sequencebeans::PropertyValue()),
+uno::UNO_QUERY_THROW);
+xPara-dispose();
 }
 
 UniReference  XMLTextImportHelper  xTxtImport =
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa vcl/generic

2014-08-13 Thread Umesh Kadam
 sw/qa/core/data/ooxml/pass/fdo78906.docx |binary
 vcl/generic/glyphs/scrptrun.cxx  |9 -
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit fbb9bdef45d3a013b5027acc1ceb7faa77f531a4
Author: Umesh Kadam umesh.ka...@synerzip.com
Date:   Thu May 29 12:59:13 2014 +0530

fdo#78906 (+dup fdo#82484): File crashes while opening.

Handled a memory corruption.

Cherry-picked from 14ce4b337232f8fb21cc67e7a2844a7de81dfc4c

Change-Id: I195d17bcd0a9a86bcc96cc7ad14f1d5f2908cf8c
Reviewed-on: https://gerrit.libreoffice.org/9545
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
Reviewed-on: https://gerrit.libreoffice.org/10897
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/core/data/ooxml/pass/fdo78906.docx 
b/sw/qa/core/data/ooxml/pass/fdo78906.docx
new file mode 100644
index 000..1a6c6ea
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo78906.docx differ
diff --git a/vcl/generic/glyphs/scrptrun.cxx b/vcl/generic/glyphs/scrptrun.cxx
index 9e8eef0..f72d296 100644
--- a/vcl/generic/glyphs/scrptrun.cxx
+++ b/vcl/generic/glyphs/scrptrun.cxx
@@ -207,7 +207,14 @@ UBool ScriptRun::next()
 // pop it from the stack
 if (pairIndex = 0  (pairIndex  1) != 0  parenSP = 0) {
 parenSP -= 1;
-startSP -= 1;
+/* decrement startSP only if it is = 0,
+   decrementing it unnecessarily will lead to memory corruption
+   while processing the above while block.
+   e.g. startSP = -4 , parenSP = -1
+*/
+if (startSP = 0) {
+startSP -= 1;
+}
 }
 } else {
 // if the run broke on a surrogate pair,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-08-11 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo82106.rtf  |4 
 sw/qa/extras/rtfimport/rtfimport.cxx  |6 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 +++
 3 files changed, 13 insertions(+)

New commits:
commit 4c9f600eb3ab76f2f4f4fde0cdc3bc91862d029b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Aug 10 20:25:52 2014 +0200

fdo#82106 RTF import: fix missing tab after special footnote

(cherry picked from commit 8ae087b8fcc25f5ce83e339d447d2899d3059d45)

Change-Id: I5ea45dbed652231acdcc3632ced728ed8bcb621a
Reviewed-on: https://gerrit.libreoffice.org/10861
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo82106.rtf 
b/sw/qa/extras/rtfimport/data/fdo82106.rtf
new file mode 100644
index 000..391914a
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo82106.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+hello{\footnote footnote content}\par
+before\tab after\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index ff2cd1a..ad42e6c 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1873,6 +1873,12 @@ DECLARE_RTFIMPORT_TEST(testFdo80742, fdo80742.rtf)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getPropertysal_Int32(xPropertySet, 
OutlineLevel));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo82106, fdo82106.rtf)
+{
+// Tab was missing after footnote not containing a tab.
+getParagraph(2, before\tafter);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f44b2bd..ad460fa 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1721,6 +1721,9 @@ void DomainMapper_Impl::PushAnnotation()
 
 void DomainMapper_Impl::PopFootOrEndnote()
 {
+// In case the foot or endnote did not contain a tab.
+m_bIgnoreNextTab = false;
+
 if (!m_aTextAppendStack.empty())
 m_aTextAppendStack.pop();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source writerfilter/source

2014-08-08 Thread nrbrtx
 sw/qa/extras/rtfexport/data/fdo79599.rtf   |   38 
 sw/qa/extras/rtfexport/rtfexport.cxx   |9 +++
 sw/qa/extras/rtfimport/data/fdo79599.rtf   |   38 
 sw/qa/extras/rtfimport/rtfimport.cxx   |   57 -
 sw/source/filter/ww8/rtfattributeoutput.cxx|2 
 writerfilter/source/dmapper/DomainMapper.cxx   |2 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 
 7 files changed, 144 insertions(+), 4 deletions(-)

New commits:
commit 22731ba9e15978ab1d1ed98a29d88431cf674257
Author: nrb...@gmail.com nrb...@gmail.com
Date:   Tue Jun 10 12:26:26 2014 +0400

fdo#79599: use \highlightN instead of \chcbpatN in RTF import and export

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

(cherry picked from commit 7eafd8ccac56d7503b4287dfa3acac2cf0560b20)

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

Change-Id: I98ef606fb73368a3c275819cb83b936e2162769d
Reviewed-on: https://gerrit.libreoffice.org/10813
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfexport/data/fdo79599.rtf 
b/sw/qa/extras/rtfexport/data/fdo79599.rtf
new file mode 100755
index 000..f908709
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo79599.rtf
@@ -0,0 +1,38 @@
+{\rtf1\deff0
+{\fonttbl
+{\f000 Courier New;}
+}
+{\colortbl;
+\red0\green0\blue0;
+\red255\green255\blue0;
+\red0\green255\blue0;
+\red0\green255\blue255;
+\red255\green0\blue255;
+\red0\green0\blue255;
+\red255\green0\blue0;
+\red0\green0\blue128;
+\red0\green128\blue128;
+\red0\green128\blue0;
+\red128\green0\blue128;
+\red128\green0\blue0;
+\red128\green128\blue0;
+\red128\green128\blue128;
+\red192\green192\blue192;
+}
+\highlight0 Should be ignored\par
+\highlight2 #00 = Yellow\par
+\highlight3 #00FF00 = Green\par
+\highlight4 #00 = Cyan\par
+\highlight5 #FF00FF = Magenta\par
+\highlight6 #FF = Blue\par
+\highlight7 #FF = Red\par
+\highlight8 #80 = Dark blue\par
+\highlight9 #008080 = Dark cyan\par
+\highlight10 #008000 = Dark green\par
+\highlight11 #800080 = Dark magenta\par
+\highlight12 #80 = Dark red\par
+\highlight13 #808000 = Dark yellow\par
+\highlight14 #808080 = Dark gray\par
+\highlight15 #C0C0C0 = Light gray\par
+\highlight1 #00 = Black\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index e4ed685..0617258 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -650,6 +650,15 @@ DECLARE_RTFEXPORT_TEST(testFdo80167, fdo80167.rtf)
 CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+DECLARE_RTFEXPORT_TEST(testFdo79599, fdo79599.rtf)
+{
+// test for \highlightNN, document has full \colortbl (produced in MS Word 
2003 or 2007)
+
+// test \highlight11 = dark magenta
+uno::Referencebeans::XPropertySet xRun(getRun(getParagraph(11),1), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(0x800080), getPropertysal_uInt32(xRun, 
CharBackColor));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/rtfimport/data/fdo79599.rtf 
b/sw/qa/extras/rtfimport/data/fdo79599.rtf
new file mode 100755
index 000..f908709
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo79599.rtf
@@ -0,0 +1,38 @@
+{\rtf1\deff0
+{\fonttbl
+{\f000 Courier New;}
+}
+{\colortbl;
+\red0\green0\blue0;
+\red255\green255\blue0;
+\red0\green255\blue0;
+\red0\green255\blue255;
+\red255\green0\blue255;
+\red0\green0\blue255;
+\red255\green0\blue0;
+\red0\green0\blue128;
+\red0\green128\blue128;
+\red0\green128\blue0;
+\red128\green0\blue128;
+\red128\green0\blue0;
+\red128\green128\blue0;
+\red128\green128\blue128;
+\red192\green192\blue192;
+}
+\highlight0 Should be ignored\par
+\highlight2 #00 = Yellow\par
+\highlight3 #00FF00 = Green\par
+\highlight4 #00 = Cyan\par
+\highlight5 #FF00FF = Magenta\par
+\highlight6 #FF = Blue\par
+\highlight7 #FF = Red\par
+\highlight8 #80 = Dark blue\par
+\highlight9 #008080 = Dark cyan\par
+\highlight10 #008000 = Dark green\par
+\highlight11 #800080 = Dark magenta\par
+\highlight12 #80 = Dark red\par
+\highlight13 #808000 = Dark yellow\par
+\highlight14 #808080 = Dark gray\par
+\highlight15 #C0C0C0 = Light gray\par
+\highlight1 #00 = Black\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 21458df..ff2cd1a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -544,6 +544,59 @@ DECLARE_RTFIMPORT_TEST(testFdo50539, fdo50539.rtf)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), 
getPropertysal_Int32(getRun(getParagraph(1), 1), CharBackColor));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo79599, fdo79599.rtf)
+{
+// test for \highlightNN, document has full \colortbl (produced in MS Word 
2003 or 2007)
+
+// ignore \highlight0
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-08-04 Thread Zolnai Tamás
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |2 ++
 writerfilter/source/dmapper/DomainMapper.cxx |2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit e9297597088f36d4072515fd46d1299381dcfe6b
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Sun Aug 3 10:45:23 2014 +0200

fdo#80986: disable highlight DOCX import

Highlight support is not implemented fully, so
it seems better to disable DOCX import of it until
it is finished.
Highlight can't be modified on the UI and is not
saved to ODT/DOC (regression).

Regression from:
8b949134441056a1455d67ddfdd7e0bc5f2ee682

Change-Id: I94891769766ae90017e8afa70e65d080d5270202
(cherry picked from commit b5e60724ac73bb0e62b249145a8931fd6166bb69)
Reviewed-on: https://gerrit.libreoffice.org/10722
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 8942d4c..18c4a7e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1486,6 +1486,7 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, smartart.docx)
 CPPUNIT_ASSERT_EQUAL(OUString(RenderedShapes), nValue); // Rendered 
bitmap has the proper name
 }
 
+/*
 DECLARE_OOXMLEXPORT_TEST(testCharHighlight, char_highlight.docx)
 {
 const uno::Reference text::XTextRange  xPara = getParagraph(1);
@@ -1532,6 +1533,7 @@ DECLARE_OOXMLEXPORT_TEST(testCharHighlight, 
char_highlight.docx)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff), 
getPropertysal_Int32(xRun,CharBackColor));
 }
 }
+*/
 
 DECLARE_OOXMLEXPORT_TEST(testFontNameIsEmpty, font-name-is-empty.docx)
 {
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 215bbaf..35ad80e 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1333,7 +1333,7 @@ void DomainMapper::sprmWithProps( Sprm rSprm, 
PropertyMapPtr rContext )
 {
 sal_Int32 nColor = 0;
 if( (mbIsHighlightSet = getColorFromIndex(nIntValue, nColor)) )
-rContext-Insert(PROP_CHAR_HIGHLIGHT, uno::makeAny( nColor ));
+rContext-Insert(PROP_CHAR_BACK_COLOR, uno::makeAny( nColor ));
 else if (mnBackgroundColor)
 rContext-Insert(PROP_CHAR_BACK_COLOR, uno::makeAny( 
mnBackgroundColor ));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-08-04 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/ole-inline.rtf |  188 +
 sw/qa/extras/rtfimport/rtfimport.cxx   |6 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |3 
 3 files changed, 197 insertions(+)

New commits:
commit b28c11025b08cae4cd4685c75fbc474d2c216fb0
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Aug 1 16:46:54 2014 +0200

RTF import: fix as-char anchored OLE objects

Regression from 2a35f5c7945d00b6f6e21fc7cf5b05b184eba88f (DOCX OLE
import: inherit anchor type from replacement graphic, 2014-02-18), then
problem was that dmapper expected that the anchor type of the
replacement graphic is set, but the RTF tokenizer wasn't adapted to
fulfill this requirement.

(cherry picked from commit 43b88364b0b05def27899d585a1dab46ba3fb729)

Conflicts:
sw/qa/extras/inc/swmodeltestbase.hxx
sw/qa/extras/rtfimport/rtfimport.cxx

Change-Id: I0f7e1a71052f337793d6f844fe5476c3868c03f4
Reviewed-on: https://gerrit.libreoffice.org/10677
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/ole-inline.rtf 
b/sw/qa/extras/rtfimport/data/ole-inline.rtf
new file mode 100644
index 000..b8af690
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/ole-inline.rtf
@@ -0,0 +1,188 @@
+{\rtf1
+{\object\objemb\objw797\objh299
+{\*\objclass Equation.3}
+{\*\objdata 
010502000b004571756174696f6e2e330c
+d0cf11e0a1b11ae13e000300feff090006000100011002000100feff
+
+
+
+fdff0400fefffefffeff
+
+
+
+52006f006f007400200045006e0074007200790016000500010002ce0200c046
+030201004f006c0065000a0002000200
+1400010043006f006d0070004f0062006a00120002000300
+010066004500710075006100740069006f006e0020004e006100740069007600650022000400
+03004600feff0200feff0400fefffeff

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-08-04 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo80742.rtf   |6 ++
 sw/qa/extras/rtfimport/rtfimport.cxx   |7 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |3 +++
 3 files changed, 16 insertions(+)

New commits:
commit 6ce5eaf63f2bcc3f61abd20bbf84751c3ba4741e
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Aug 2 21:44:02 2014 +0200

fdo#80742 RTF filter: import RTF_OUTLINELEVEL

(cherry picked from commit c3657be928732f1b3b3b238f625de304a90a1ae1)

Change-Id: I49d94bd72af610e88128cd405e4786d2e9ba65ed
Reviewed-on: https://gerrit.libreoffice.org/10727
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo80742.rtf 
b/sw/qa/extras/rtfimport/data/fdo80742.rtf
new file mode 100644
index 000..6055d13
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo80742.rtf
@@ -0,0 +1,6 @@
+{\rtf1
+{\stylesheet
+{\s13\outlinelevel1 Heading 2;}
+}
+\pard\s13\plain hello\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 5ed5d36..21458df 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1813,6 +1813,13 @@ DECLARE_RTFIMPORT_TEST(testOleInline, ole-inline.rtf)
 CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, 
getPropertytext::TextContentAnchorType(getShape(1), AnchorType));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo80742, fdo80742.rtf)
+{
+uno::Referencebeans::XPropertySet 
xPropertySet(getStyles(ParagraphStyles)-getByName(Heading 2), 
uno::UNO_QUERY);
+// This was 0, outline level was body text.
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getPropertysal_Int32(xPropertySet, 
OutlineLevel));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5823b70..1917276 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4550,6 +4550,9 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 case RTF_RIN:
 lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, 
NS_ooxml::LN_CT_PPrBase_ind, NS_ooxml::LN_CT_Ind_end, pIntValue);
 break;
+case RTF_OUTLINELEVEL:
+
m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_outlineLvl, 
pIntValue);
+break;
 default:
 {
 SAL_INFO(writerfilter, TODO handle value '  
lcl_RtfToString(nKeyword)  ');
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-08-03 Thread Michael Stahl
 sw/qa/extras/rtfimport/data/fdo81944.rtf  |   15 ++
 sw/qa/extras/rtfimport/rtfimport.cxx  |   13 +
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 +-
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|   51 --
 writerfilter/source/rtftok/rtfdocumentimpl.hxx|3 -
 5 files changed, 52 insertions(+), 36 deletions(-)

New commits:
commit aed0f1e27be04ecd43b2edd3885c1f2eea0a3de9
Author: Michael Stahl mst...@redhat.com
Date:   Sat Aug 2 18:55:55 2014 +0200

fdo#81944: writerfilter: RTF import: don't drop fonts in stylesheet

The font definitions in the style sheet meet an untimely death in
StyleSheetTable::lcl_sprm(), which special-cases LN_EG_RPrBase_rFonts,
routing it into TblStylePrHandler.

Avoid this by sending style entries to the domain mapper in the same way
as the OOXML tokenizer, i.e., with paragraph and run properties nested
below CT_Style_pPr/rPr.

This reveals that the CT_Style_basedOn was wrongly handled as paragraph
property.

Change-Id: Ic724ba48fe36bf782b1b430bdafdb1df480d5ad3
(cherry picked from commit f8e8e476aa0a5576234dbb4daac9dc299e044e61)
Reviewed-on: https://gerrit.libreoffice.org/10698
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/data/fdo81944.rtf 
b/sw/qa/extras/rtfimport/data/fdo81944.rtf
new file mode 100644
index 000..780e9bd
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo81944.rtf
@@ -0,0 +1,15 @@
+{\rtf1
+
+{\fonttbl
+{\f38\fbidi \fswiss\fcharset0\fprq2 Segoe UI;}
+{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+}
+
+{\stylesheet
+{\qc \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 
\f38\fs18\lang1033\langfe1033 Normal;}
+}
+
+\pard
+
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index ca60321..44d49da 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1163,6 +1163,19 @@ DECLARE_RTFIMPORT_TEST(testPageBackground, 
page-background.rtf)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0x92D050), 
getPropertysal_Int32(xPageStyle, BackColor));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo81944, fdo81944.rtf)
+{
+// font properties in style were not imported
+uno::Referencebeans::XPropertySet xPropertySet(
+getStyles(ParagraphStyles)-getByName(Standard), uno::UNO_QUERY);
+uno::Referencestyle::XStyle xStyle(xPropertySet, uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString(Segoe UI), getPropertyOUString(xStyle, 
CharFontName));
+CPPUNIT_ASSERT_EQUAL(9.0f, getPropertyfloat(xStyle, CharHeight));
+// not sure if this should be set on Asian or Complex or both?
+CPPUNIT_ASSERT_EQUAL(OUString(Times New Roman), 
getPropertyOUString(xStyle, CharFontNameComplex));
+CPPUNIT_ASSERT_EQUAL(11.0f, getPropertyfloat(xStyle, 
CharHeightComplex));
+}
+
 DECLARE_RTFIMPORT_TEST(testFdo62044, fdo62044.rtf)
 {
 // The problem was that RTF import during copypaste did not ignore 
existing paragraph styles.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f6dc73e..f44b2bd 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4663,15 +4663,17 @@ uno::Referencecontainer::XIndexAccess 
DomainMapper_Impl::GetCurrentNumberingRu
 
 // So we are in a paragraph style and it has numbering. Look up the 
relevant numbering rules.
 OUString aListName = ListDef::GetStyleName(nListId);
-uno::Reference style::XStyleFamiliesSupplier  
xStylesSupplier(GetTextDocument(), uno::UNO_QUERY);
+uno::Reference style::XStyleFamiliesSupplier  
xStylesSupplier(GetTextDocument(), uno::UNO_QUERY_THROW);
 uno::Reference container::XNameAccess  xStyleFamilies = 
xStylesSupplier-getStyleFamilies();
 uno::Referencecontainer::XNameAccess xNumberingStyles;
 xStyleFamilies-getByName(NumberingStyles) = xNumberingStyles;
 uno::Referencebeans::XPropertySet 
xStyle(xNumberingStyles-getByName(aListName), uno::UNO_QUERY);
 xRet.set(xStyle-getPropertyValue(NumberingRules), uno::UNO_QUERY);
 }
-catch( const uno::Exception )
+catch (const uno::Exception e)
 {
+SAL_WARN(writerfilter.dmapper,
+GetCurrentNumberingRules: exception caught:   e.Message);
 }
 return xRet;
 }
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 21708cc..c716b2f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1164,7 +1164,7 @@ void RTFDocumentImpl::text(OUString rString)
 
m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Style_name, pValue);
 
 writerfilter::ReferenceProperties::Pointer_t 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-08-01 Thread Michael Stahl
 sw/qa/extras/rtfimport/data/fdo81892.rtf   |   26 +
 sw/qa/extras/rtfimport/rtfimport.cxx   |9 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   21 
 3 files changed, 56 insertions(+)

New commits:
commit 9294fd3f8630391f3b85031a345a53d066934a42
Author: Michael Stahl mst...@redhat.com
Date:   Fri Aug 1 10:44:00 2014 +0200

fdo#81892: writerfilter: RTF import: add support for table row alignment

These keywords were simply not implemented.

(cherry picked from commit df041e468baf604f6e2606e5b632aa654b19a65d)

fdo#81892: oops forgot the test document
(cherry picked from commit bac3cdb1b8afd2fa8fdfea99d1d01dc2770d1ef1)

Change-Id: Ib4d07a4b2dfb07cfd56a4ee07d7c14d1c59323f9
Reviewed-on: https://gerrit.libreoffice.org/10674
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/data/fdo81892.rtf 
b/sw/qa/extras/rtfimport/data/fdo81892.rtf
new file mode 100644
index 000..73cd53d
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo81892.rtf
@@ -0,0 +1,26 @@
+{\rtf1
+
+\pard
+\qc
+\page
+Performance
+\par
+
+
+\trowd
+\trqc
+\cellx8199
+
+\pard
+\intbl
+13
+\cell
+
+\trowd
+\trqc
+\cellx8199
+\row
+
+\pard
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index cfa347b..f36b530 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -337,6 +337,15 @@ DECLARE_RTFIMPORT_TEST(testFdo46955, fdo46955.rtf)
 }
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo81892, fdo81892.rtf)
+{
+// table was not centered
+uno::Referencetext::XTextTablesSupplier xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xTables(xTextTablesSupplier-getTextTables(), uno::UNO_QUERY);
+uno::Referencetext::XTextTable xTable(xTables-getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, 
getPropertysal_Int16(xTable, HoriOrient));
+}
+
 DECLARE_RTFIMPORT_TEST(testFdo45394, fdo45394.rtf)
 {
 uno::Referencetext::XText xHeaderText = getProperty 
uno::Referencetext::XText 
(getStyles(PageStyles)-getByName(DEFAULT_STYLE), HeaderText);
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 68db15d..01a8574 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2693,6 +2693,27 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 return 0;
 }
 
+switch (nKeyword)
+{
+case RTF_TRQL:
+nParam = 0;
+break;
+case RTF_TRQC:
+nParam = 1;
+break;
+case RTF_TRQR:
+nParam = 2;
+break;
+default:
+break;
+}
+if (nParam = 0)
+{
+RTFValue::Pointer_t const pValue(new RTFValue(nParam));
+m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TrPrBase_jc, 
pValue);
+return 0;
+}
+
 // Cell Text Flow
 switch (nKeyword)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-08-01 Thread Michael Stahl
 sw/qa/extras/rtfimport/rtfimport.cxx   |4 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |4 
 2 files changed, 8 insertions(+)

New commits:
commit 22688ede28db14e5947cf73e85fcd2156e26ec5e
Author: Michael Stahl mst...@redhat.com
Date:   Fri Aug 1 10:47:49 2014 +0200

fdo#81893: writerfilter: RTF import: \qc before \page was lost

The paragraph properties need to be applied to the paragraph following
the \page too, which did not happen in this case.

Also the minimized test doc shows that checkNeedPap() must be preceded
by checkFirstRun(), since there is no run preceding the \page.

(regression from 94765a1b3f543b3b60f8c1de05048d12f2576be4)

Change-Id: Id286c4fbdeee688fa4f6b24063b634bac637eab6
(cherry picked from commit 008d1187a9f3b36d6cbf31742632d237afecf1bd)
Reviewed-on: https://gerrit.libreoffice.org/10675
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index f36b530..ca60321 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -344,6 +344,10 @@ DECLARE_RTFIMPORT_TEST(testFdo81892, fdo81892.rtf)
 uno::Referencecontainer::XIndexAccess 
xTables(xTextTablesSupplier-getTextTables(), uno::UNO_QUERY);
 uno::Referencetext::XTextTable xTable(xTables-getByIndex(0), 
uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, 
getPropertysal_Int16(xTable, HoriOrient));
+
+// fdo#81893: paragraph with \page was not centered
+uno::Referencetext::XTextRange xPara(getParagraph(2, Performance));
+CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, 
static_caststyle::ParagraphAdjust(getPropertysal_Int16(xPara, 
ParaAdjust)));
 }
 
 DECLARE_RTFIMPORT_TEST(testFdo45394, fdo45394.rtf)
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 01a8574..2372a29 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2301,11 +2301,15 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
 }
 else
 {
+checkFirstRun();
 checkNeedPap();
 sal_uInt8 sBreak[] = { 0xc };
 Mapper().text(sBreak, 1);
 if (!m_bNeedPap)
+{
 parBreak();
+m_bNeedPap = true;
+}
 m_bNeedCr = true;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-30 Thread Umesh Kadam
 sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx |binary
 sw/qa/extras/ooxmlimport/data/fdo78904.docx   |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   11 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   23 --
 4 files changed, 28 insertions(+), 6 deletions(-)

New commits:
commit 77ab92bfae9cd32f50e993e0fd8cdec4e6e4a2ff
Author: Umesh Kadam umesh.ka...@synerzip.com
Date:   Fri Jun 13 17:26:19 2014 +0530

fdo#78904 : LO hangs while saving the document.

- In case of framePr attributes being omitted in original xml, LO defaults
  such attributes to incorrect values.
- Correcting these values in this fix.
- This fix stops LO from getting hang while saving the document, the actual
  fix needs to be somewhere in the table layout. We need to restrict the
  frame from being considered as part of the table as MSO does not allow
  frame to be part of a table.

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

This also fixes fdo#79391.

Change-Id: I4c35f7eff6ca1122901f5667fc26b849df527f60
Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx 
b/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx
new file mode 100644
index 000..dce50f3
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx 
differ
diff --git a/sw/qa/extras/ooxmlimport/data/fdo78904.docx 
b/sw/qa/extras/ooxmlimport/data/fdo78904.docx
new file mode 100644
index 000..c171ae2
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo78904.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index de1e641..1dc6161 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1175,6 +1175,17 @@ DECLARE_OOXMLIMPORT_TEST(testToolsLineNumbering, 
tools-line-numbering.docx)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nValue);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testfdo78904, fdo78904.docx)
+{
+uno::Referencetext::XTextFramesSupplier xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xIndexAccess(xTextFramesSupplier-getTextFrames(), uno::UNO_QUERY);
+if (xIndexAccess-getCount())
+{
+uno::Referencebeans::XPropertySet 
xFrame(xIndexAccess-getByIndex(0), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(0)), 
getPropertysal_Int32(xFrame, HoriOrientPosition));
+}
+}
+
 DECLARE_OOXMLIMPORT_TEST(testFdo60922, fdo60922.docx)
 {
 // This was 0, not 100, due to wrong import of w:position w:val=0
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index bdad3b1..f6dc73e 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -42,6 +42,7 @@
 #include com/sun/star/text/HoriOrientation.hpp
 #include com/sun/star/text/VertOrientation.hpp
 #include com/sun/star/text/ReferenceFieldPart.hpp
+#include com/sun/star/text/RelOrientation.hpp
 #include com/sun/star/text/ReferenceFieldSource.hpp
 #include com/sun/star/text/SizeType.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
@@ -807,6 +808,8 @@ void lcl_AddRangeAndStyle(
 
 //define some default frame width - 0cm ATM: this allow the frame to be 
wrapped around the text
 #define DEFAULT_FRAME_MIN_WIDTH 0
+#define DEFAULT_FRAME_MIN_HEIGHT 0
+#define DEFAULT_VALUE 0
 
 void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
 {
@@ -860,7 +863,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
 pFrameProperties[1].Value =
 rAppendContext.pLastParagraphProperties-Geth()  0 ?
 rAppendContext.pLastParagraphProperties-Geth() :
-pStyleProperties-Geth();
+pStyleProperties-Geth()  0 ? 
pStyleProperties-Geth() : DEFAULT_FRAME_MIN_HEIGHT;
 
 pFrameProperties[2].Value = sal_Int16(
 rAppendContext.pLastParagraphProperties-GethRule() = 0 ?
@@ -875,13 +878,17 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( 
)
 pStyleProperties-GetxAlign() = 0 ? 
pStyleProperties-GetxAlign() : text::HoriOrientation::NONE );
 pFrameProperties[4].Value = nHoriOrient;
 
+//set a non negative default value
 pFrameProperties[5].Value =
 rAppendContext.pLastParagraphProperties-IsxValid() ?
-rAppendContext.pLastParagraphProperties-Getx() : 
pStyleProperties-Getx();
+rAppendContext.pLastParagraphProperties-Getx() :
+

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-29 Thread Michael Stahl
 sw/qa/extras/rtfimport/data/fdo78502.rtf   |   12 
 sw/qa/extras/rtfimport/rtfimport.cxx   |6 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   11 ---
 3 files changed, 26 insertions(+), 3 deletions(-)

New commits:
commit bd300cfba34ee8d4cc479cbbe9cf8703590c74b6
Author: Michael Stahl mst...@redhat.com
Date:   Fri Jul 18 23:40:40 2014 +0200

fdo#78502: writerfilter: RTF import: handle \u keyword inside levelnumbers

The ; terminates an entry and shall not be inserted as text,
even if some over-engineered producer encodes it as {\uc1 \u59 ?}.

Also, remove the special-casing of the \leveltext destination, since the
bugdoc does contain \uc inside it and it's not obvious why that should
be ignored.

(cherry picked from commit e93f0852477b44df986807860c821319a921b199)

fdo#78502: actually empty parameter to getParagraph() is not tested
(cherry picked from commit b9dca968c6fd0ab5ca140c65b0e54d153cd34986)

Change-Id: I1e19c9df39597cb1b22bbda97853c829d7812e29
Reviewed-on: https://gerrit.libreoffice.org/10396
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/data/fdo78502.rtf 
b/sw/qa/extras/rtfimport/data/fdo78502.rtf
new file mode 100644
index 000..2a1baf3
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo78502.rtf
@@ -0,0 +1,12 @@
+{\rtf \ansi \ansicpg0 \deff0
+{\fonttbl {\f0 \froman \fcharset0 \fprq2 Times New Roman{\*\falt Times New 
Roman};}{\f1 \fnil \fcharset134 \fprq0 {\uc1 \u23435 ?}{\uc1 \u20307 ?}{\*\falt 
{\uc1 \u23435 ?}{\uc1 \u20307 ?}};}{\f2 \froman \fcharset0 \fprq0 
Symbol{\*\falt Symbol};}}
+{\*\listtable
+{\list \listtemplateid300746803 \listhybrid
+{\listlevel \levelnfc23 \levelnfcn23 \leveljc0 \leveljcn0 \levelstartat1 
\levelfollow0 \levelspace0 \levelindent0 \levellegal0 \levelnorestart0 
{\leveltext {\uc1 \u1 ?}{\uc1 \u61623 ?}{\uc1 \u59 ?}}{\levelnumbers {\uc1 \u59 
?}}\fs20 \dbch \af1 \hich \af2 \loch \f2 \li720 \lin720 \fi-360 \jclisttab 
\tx720 }
+{\listlevel \levelnfc23 \levelnfcn23 \leveljc0 \leveljcn0 \levelstartat1 
\levelfollow0 \levelspace0 \levelindent0 \levellegal0 \levelnorestart0 
{\leveltext {\uc1 \u1 ?}{\uc1 \u61623 ?}{\uc1 \u59 ?}}{\levelnumbers {\uc1 \u59 
?}}\fs20 \dbch \af1 \hich \af2 \loch \f2 \li1440 \lin1440 \fi-360 \jclisttab 
\tx1440 }
+{\listlevel \levelnfc23 \levelnfcn23 \leveljc0 \leveljcn0 \levelstartat1 
\levelfollow0 \levelspace0 \levelindent0 \levellegal0 \levelnorestart0 
{\leveltext {\uc1 \u1 ?}{\uc1 \u61623 ?}{\uc1 \u59 ?}}{\levelnumbers {\uc1 \u59 
?}}\fs20 \dbch \af1 \hich \af2 \loch \f2 \li2160 \lin2160 \fi-360 \jclisttab 
\tx2160 }
+{\listname ;}
+\listid297210762 }
+}
+foo
+\par }
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index a6474fc..128e2a3 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -980,6 +980,12 @@ DECLARE_RTFIMPORT_TEST(testFdo58646line, 
fdo58646line.rtf)
 getParagraph(1, foo\nbar);
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo78502, fdo78502.rtf)
+{
+// ; separators were inserted as text
+getParagraph(1, foo);
+}
+
 DECLARE_RTFIMPORT_TEST(testFdo58646, fdo58646.rtf)
 {
 // Page break was ignored inside a continuous section, on title page.
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 1210aa1..bdd54c7 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3829,9 +3829,14 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 // static_cast() will do the right thing.
 if ((SAL_MIN_INT16 = nParam)  (nParam = SAL_MAX_UINT16))
 {
-m_aUnicodeBuffer.append(static_castsal_Unicode(nParam));
-if (m_aStates.top().nDestinationState != DESTINATION_LEVELTEXT)
-m_aStates.top().nCharsToSkip = m_aStates.top().nUc;
+if (m_aStates.top().nDestinationState == DESTINATION_LEVELNUMBERS)
+{
+if (nParam != ';')
+m_aStates.top().aLevelNumbers.push_back(sal_Int32(nParam));
+}
+else
+m_aUnicodeBuffer.append(static_castsal_Unicode(nParam));
+m_aStates.top().nCharsToSkip = m_aStates.top().nUc;
 }
 break;
 case RTF_LEVELFOLLOW:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source writerfilter/source

2014-07-29 Thread Luboš Luňák
 sw/qa/extras/ooxmlimport/data/floating-table-section-columns.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |7 
+++
 sw/qa/extras/ww8import/data/floating-table-section-columns.doc|binary
 sw/qa/extras/ww8import/ww8import.cxx  |7 
+++
 sw/source/filter/ww8/ww8par6.cxx  |4 +++-
 writerfilter/source/dmapper/PropertyMap.cxx   |4 +++-
 writerfilter/source/dmapper/PropertyMap.hxx   |1 +
 7 files changed, 21 insertions(+), 2 deletions(-)

New commits:
commit c20dcded64f85b464bf64bbf3e30ec4e4a8ee205
Author: Luboš Luňák l.lu...@collabora.com
Date:   Mon Jul 7 13:56:02 2014 +0200

fix floating table over section with several columns (part of bnc#875383)

Change-Id: Ic6e75cc2cedb61754b45bc4678a1185f580d5ed6
Reviewed-on: https://gerrit.libreoffice.org/10431
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/ooxmlimport/data/floating-table-section-columns.docx 
b/sw/qa/extras/ooxmlimport/data/floating-table-section-columns.docx
new file mode 100644
index 000..50bb7ac
Binary files /dev/null and 
b/sw/qa/extras/ooxmlimport/data/floating-table-section-columns.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index a0c09c9..de1e641 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2202,6 +2202,13 @@ DECLARE_OOXMLIMPORT_TEST(testTableBtlrCenter, 
table-btlr-center.docx)
 CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, 
getPropertysal_Int16(xTable-getCellByName(A2), VertOrient));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testFloatingTableSectionColumns, 
floating-table-section-columns.docx)
+{
+OUString tableWidth = 
parseDump(/root/page[1]/body/section/column[2]/body/txt/anchored/fly/tab/infos/bounds,
 width);
+// table width was restricted by a column
+CPPUNIT_ASSERT( tableWidth.toInt32()  1 );
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ww8import/data/floating-table-section-columns.doc 
b/sw/qa/extras/ww8import/data/floating-table-section-columns.doc
new file mode 100644
index 000..6471ded
Binary files /dev/null and 
b/sw/qa/extras/ww8import/data/floating-table-section-columns.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 7cd6153..68cb9c8 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -473,6 +473,13 @@ DECLARE_WW8IMPORT_TEST(testFdp80333, fdo80333.doc)
 
 #endif
 
+DECLARE_WW8IMPORT_TEST(testFloatingTableSectionColumns, 
floating-table-section-columns.doc)
+{
+OUString tableWidth = 
parseDump(/root/page[1]/body/section/column[2]/body/txt/anchored/fly/tab/infos/bounds,
 width);
+// table width was restricted by a column
+CPPUNIT_ASSERT( tableWidth.toInt32()  1 );
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index e0100ae..6942f88 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -4939,7 +4939,9 @@ bool SwWW8ImplReader::ParseTabPos(WW8_TablePos *pTabPos, 
WW8PLCFx_Cp_FKP* pPap)
 // If the table is wider than the text area, then don't create a fly
 // for the table: no wrapping will be performed anyway, but multi-page
 // tables will be broken.
-pTabPos-bNoFly = nTableWidth = nTextAreaWidth;
+// If there are columns, do create a fly, as the flow of the columns
+// would otherwise restrict the table.
+pTabPos-bNoFly = nTableWidth = nTextAreaWidth   
maSectionManager.CurrentSectionColCount()  2;
 }
 return bRet;
 }
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 6a60e41..dab3285 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -919,8 +919,10 @@ void SectionPropertyMap::CloseSectionGroup( 
DomainMapper_Impl rDM_Impl )
 // tables will be broken.
 // If the position is relative to the edge of the page, then we always
 // create the fly.
+// If there are columns, always create the fly, otherwise the columns 
would
+// restrict geometry of the table.
 if ( ( rInfo.getPropertyValue(HoriOrientRelation) == 
text::RelOrientation::PAGE_FRAME ) ||
- ( rInfo.m_nTableWidth  nTextAreaWidth ) )
+ ( rInfo.m_nTableWidth  nTextAreaWidth ) || ColumnCount() + 1 = 
2 )
 xBodyText-convertToTextFrame(rInfo.m_xStart, rInfo.m_xEnd, 
rInfo.m_aFrameProperties);
 }
 rPendingFloatingTables.clear();
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-07-29 Thread Luboš Luňák
 sw/qa/extras/ww8import/data/floating-table-section-margins.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx   |   12 
++
 sw/source/filter/ww8/ww8par.cxx|4 +++
 3 files changed, 16 insertions(+)

New commits:
commit 75b89f28b9b3dddf3f5c64c94012528390a0e4f4
Author: Luboš Luňák l.lu...@collabora.com
Date:   Mon Jul 21 10:56:52 2014 +0200

ww8import create a pagedesc if continuous section changes margins 
(bnc#875383)

This is similar to what writerfilter does. MSWord can have one page with 
several
different margins, which are saved using continuous sections, which causes 
all
kinds of trouble, because either we treat them as Writer sections, which 
means
we lose some of the data, or we treat them as Writer page styles, which 
causes
spurious page breaks if in the wrong place. Either option has its problems, 
but
here it seems slightly better to go for keeping the data and hoping the page
break will be in a place where a break will be anyway.

Change-Id: I8f52aa820750da6788ea04180a15ac334f6bf87b
Reviewed-on: https://gerrit.libreoffice.org/10432
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/ww8import/data/floating-table-section-margins.doc 
b/sw/qa/extras/ww8import/data/floating-table-section-margins.doc
new file mode 100644
index 000..f414be7
Binary files /dev/null and 
b/sw/qa/extras/ww8import/data/floating-table-section-margins.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 68cb9c8..5075b8f 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -36,6 +36,18 @@ public:
 
 #define DECLARE_WW8IMPORT_TEST(TestName, filename) 
DECLARE_SW_IMPORT_TEST(TestName, filename, Test)
 
+DECLARE_WW8IMPORT_TEST(testFloatingTableSectionMargins, 
floating-table-section-margins.doc)
+{
+sal_Int32 pageLeft = parseDump(/root/page[2]/infos/bounds, 
left).toInt32();
+sal_Int32 pageWidth = parseDump(/root/page[2]/infos/bounds, 
width).toInt32();
+sal_Int32 tableLeft = 
parseDump(/root/page[2]/body/column/body/section/column/body/txt[2]/anchored/fly/tab/infos/bounds,
 left).toInt32();
+sal_Int32 tableWidth = 
parseDump(/root/page[2]/body/column/body/section/column/body/txt[2]/anchored/fly/tab/infos/bounds,
 width).toInt32();
+CPPUNIT_ASSERT( pageWidth  0 );
+CPPUNIT_ASSERT( tableWidth  0 );
+// The table's resulting position should be roughly centered.
+CPPUNIT_ASSERT( abs(( pageLeft + pageWidth / 2 ) - ( tableLeft + 
tableWidth / 2 ))  20 );
+}
+
 DECLARE_WW8IMPORT_TEST(testN757910, n757910.doc)
 {
 // The internal margin was larger than 0.28cm
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 11fafbe..ccdc07c 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4446,6 +4446,10 @@ void wwSectionManager::InsertSegments()
 
 bool bInsertSection = (aIter != aStart)  aIter-IsContinuous()   
bThisAndPreviousAreCompatible;
 bool bInsertPageDesc = !bInsertSection;
+// HACK Force new pagedesc if margins change, otherwise e.g. floating 
tables may be anchored improperly.
+if( aIter-maSep.dyaTop != aPrev-maSep.dyaTop || 
aIter-maSep.dyaBottom != aPrev-maSep.dyaBottom
+|| aIter-maSep.dxaLeft != aPrev-maSep.dxaLeft || 
aIter-maSep.dxaRight != aPrev-maSep.dxaRight )
+bInsertPageDesc = true;
 bool bProtected = SectionIsProtected(*aIter); // do we really  need 
this ?? I guess I have a different logic in editshell which disables this...
 if (bUseEnhFields  mrReader.pWDop-fProtEnabled  
aIter-IsNotProtected())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-29 Thread Michael Stahl
 sw/qa/extras/rtfimport/data/fdo77996.rtf   |   35 +
 sw/qa/extras/rtfimport/rtfimport.cxx   |   22 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |  147 +
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |2 
 4 files changed, 161 insertions(+), 45 deletions(-)

New commits:
commit 033154d99a834024993b3faf3af9a6842dc907b8
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 22 15:05:24 2014 +0200

fdo#77996: writerfilter: RTF import: re-work destination text buffering

The problem in the bugdoc is that the ';' style terminator is encoded as
{\uc1 \u59 ?}, i.e. inside a group, so when reading the ';' the
aDestinationText of the top group is empty and the style name is lost.
Or since the style name characters are encoded in the same way, every
character is lost once the group closes.

The same problem affects some of the document properties.

Introduce an abstraction of RTFParserState::aDestinationText so that for
every destination only one of these buffers is used, regardless of
nested group structures; the aDestinationText buffer is only switched
when entering a new destination.

Also, the \revtbl and \stylesheet destinations do not contain entries
directly, i.e., every entry must be in a sub-group, so remove some
special-casing for these; however, for \fonttbl the entries may be in
groups or not.

(cherry picked from commit 82e17dbb2a16c7653a163139f0eea51faa4d46b8)

Conflicts:
writerfilter/source/rtftok/rtfdocumentimpl.cxx

Change-Id: Ica276a8b730e4a707530471ba27bfdd1582b8890
Reviewed-on: https://gerrit.libreoffice.org/10464
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/data/fdo77996.rtf 
b/sw/qa/extras/rtfimport/data/fdo77996.rtf
new file mode 100644
index 000..b5b4fde
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo77996.rtf
@@ -0,0 +1,35 @@
+{\rtf \ansi \ansicpg0 \deff0 \stshfdbch1 \stshfloch0 \stshfhich0 \deflang1033 
\deflangfe1033
+
+{\fonttbl
+{\f0 \froman \fcharset0 \fprq2 Times New Roman{\*\falt Times New Roman};}
+{\f1 \fnil \fcharset134 \fprq0 {\uc1 \u23435 ?}{\uc1 \u20307 ?}{\*\falt {\uc1 
\u23435 ?}{\uc1 \u20307 ?}};}
+{\f6 \fnil \fcharset0 \fprq0 Wingdings{\*\falt Wingdings};}
+{\f10 \fnil \fcharset0 \fprq0 Calibri{\*\falt Calibri};}
+{\f11 \fnil \fcharset134 \fprq0 {\uc1 \u24494 ?}{\uc1 \u36719 ?}{\uc1 \u38597 
?}{\uc1 \u40657 ?}{\*\falt {\uc1 \u24494 ?}{\uc1 \u36719 ?}{\uc1 \u38597 
?}{\uc1 \u40657 ?}};}
+}
+
+{\stylesheet
+{\qj \li0 \ri0 \nowidctlpar \aspalpha \aspnum \adjustright \lin0 \rin0 \itap0 
\fs21 \kerning2 \dbch \af1 \hich \af10 \loch \f10 \lang1033 \langnp1033 
\langfe2052 \langfenp2052 \snext0 Normal{\uc1 \u59 ?}}
+{\s1 \ql \li0 \ri0 \sb100 \lisb0 \sa100 \lisa0 \sbauto1 \saauto1 \widctlpar 
\aspalpha \aspnum \adjustright \lin0 \rin0 \itap0 \outlinelevel0 \b1 \fs48 
\kerning36 \dbch \af1 \hich \af1 \loch \f1 \lang1033 \langnp1033 \langfe2052 
\langfenp2052 \sbasedon0 \snext1 \slink18 heading 1{\uc1 \u59 ?}}
+{\s2 \ql \li0 \ri0 \sb100 \lisb0 \sa100 \lisa0 \sbauto1 \saauto1 \widctlpar 
\aspalpha \aspnum \adjustright \lin0 \rin0 \itap0 \outlinelevel1 \b1 \fs36 
\kerning0 \dbch \af1 \hich \af1 \loch \f1 \lang1033 \langnp1033 \langfe2052 
\langfenp2052 \sbasedon0 \snext2 \slink16 heading 2{\uc1 \u59 ?}}
+{\*\cs10 \snext10 Default Paragraph Font{\uc1 \u59 ?}}
+{\*\cs15 \fs18 \v0 \sbasedon10 \snext15 {\uc1 \u97 ?}{\uc1 \u117 ?}{\uc1 \u116 
?}{\uc1 \u104 ?}{\uc1 \u111 ?}{\uc1 \u114 ?}{\uc1 \u59 ?}}
+{\*\cs16 \b1 \fs36 \kerning0 \dbch \af1 \hich \af1 \loch \f1 \sbasedon10 
\snext16 \slink2 {\uc1 \u26631 ?}{\uc1 \u39064 ?}{\uc1 \u32 ?}{\uc1 \u50 
?}{\uc1 \u32 ?}{\uc1 \u67 ?}{\uc1 \u104 ?}{\uc1 \u97 ?}{\uc1 \u114 ?}{\uc1 \u59 
?}}
+{\*\cs17 \b1 \sbasedon10 \snext17 strong{\uc1 \u59 ?}}
+{\*\cs18 \b1 \fs48 \kerning36 \dbch \af1 \hich \af1 \loch \f1 \sbasedon10 
\snext18 \slink1 {\uc1 \u26631 ?}{\uc1 \u39064 ?}{\uc1 \u32 ?}{\uc1 \u49 
?}{\uc1 \u32 ?}{\uc1 \u67 ?}{\uc1 \u104 ?}{\uc1 \u97 ?}{\uc1 \u114 ?}{\uc1 \u59 
?}}
+{\s19 \ql \li0 \ri0 \sb375 \lisb0 \sa100 \lisa0 \saauto1 \widctlpar \aspalpha 
\aspnum \adjustright \lin0 \rin0 \itap0 \fs18 \kerning0 \dbch \af1 \hich \af1 
\loch \f1 \lang1033 \langnp1033 \langfe2052 \langfenp2052 \sbasedon0 \snext19 
{\uc1 \u101 ?}{\uc1 \u120 ?}{\uc1 \u116 ?}{\uc1 \u114 ?}{\uc1 \u97 ?}{\uc1 \u99 
?}{\uc1 \u116 ?}{\uc1 \u50 ?}{\uc1 \u59 ?}}
+}
+
+{\info
+{\title {\uc1 \u21414 ?}{\uc1 \u38376 ?}{\uc1 \u38056 ?}{\uc1 \u19994 ?}{\uc1 
\u32929 ?}{\uc1 \u20221 ?}{\uc1 \u26377 ?}{\uc1 \u38480 ?}{\uc1 \u20844 ?}{\uc1 
\u21496 ?}}
+{\author {\uc1 \u65 ?}{\uc1 \u108 ?}{\uc1 \u110 ?}{\uc1 \u32 ?}{\uc1 \u76 
?}{\uc1 \u105 ?}{\uc1 \u110 ?}{\uc1 \u32 ?}{\uc1 \u40 ?}{\uc1 \u66 ?}{\uc1 
\u101 ?}{\uc1 \u105 ?}{\uc1 \u32 ?}{\uc1 \u74 ?}{\uc1 \u105 ?}{\uc1 \u110 
?}{\uc1 \u103 ?}{\uc1 \u41 ?}}
+{\operator {\uc1 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-29 Thread Michael Stahl
 sw/qa/extras/rtfimport/data/fdo77996.rtf   |1 +
 sw/qa/extras/rtfimport/rtfimport.cxx   |   10 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   10 +++---
 3 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit dcc4c1a7d4968fa0dc2331e218861f4450ad5225
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 22 16:13:48 2014 +0200

fdo#80486 writerfilter: RTF import: ignore \par inside \ftnsep

Word can apparently have complex footnote separators, but the
domain-mapper only sets a single flag that there is a separator
(m_bHasFtnSep), so the only thing that makes sense for \par here
is to completely ignore it.

(regression from e1afe4318787425dc40f2d0b1f02fa17e925c8da)

Change-Id: I32d9b01a0a9248ba646654295a74953a6cb74fb3
(cherry picked from commit 75c5679a96437caa6041d2550562f2a4db80d586)
Reviewed-on: https://gerrit.libreoffice.org/10465
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/data/fdo77996.rtf 
b/sw/qa/extras/rtfimport/data/fdo77996.rtf
index b5b4fde..055d860 100644
--- a/sw/qa/extras/rtfimport/data/fdo77996.rtf
+++ b/sw/qa/extras/rtfimport/data/fdo77996.rtf
@@ -26,6 +26,7 @@
 {\operator {\uc1 \u106 ?}{\uc1 \u97 ?}{\uc1 \u121 ?}}
 }
 
+\fet2 {\*\ftnsep \pard \plain {\insrsid \chftnsep \par }}{\*\ftnsepc \pard 
\plain {\insrsid \chftnsepc \par }}{\*\aftnsep \pard \plain {\insrsid \chftnsep 
\par }}{\*\aftnsepc \pard \plain {\insrsid \chftnsepc \par }}
 
 {\loch \af11 \hich \af11 \dbch \f11
 {\uc1 \u21414 ?}{\uc1 \u38376 ?}{\uc1 \u38056 ?}{\uc1 \u19994 ?}{\uc1 \u32929 
?}{\uc1 \u20221 ?}{\uc1 \u26377 ?}{\uc1 \u38480 ?}{\uc1 \u20844 ?}{\uc1 \u21496 
?}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 2a956db..7e5bd67 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1281,12 +1281,14 @@ DECLARE_RTFIMPORT_TEST(testFdo77996, fdo77996.rtf)
 uno::Referencedocument::XDocumentPropertiesSupplier 
xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY);
 uno::Referencedocument::XDocumentProperties 
xProps(xDocumentPropertiesSupplier-getDocumentProperties());
 CPPUNIT_ASSERT_EQUAL(OUString(Aln Lin (Bei Jing)), xProps-getAuthor());
-CPPUNIT_ASSERT_EQUAL(
-
OUString(\xe5\x8e\xa6\xe9\x97\xa8\xe9\x92\xa8\xe4\xb8\x9a\xe8\x82\xa1\xe4\xbb\xbd\xe6\x9c\x89\xe9\x99\x90\xe5\x85\xac\xe5\x8f\xb8,
 30,
-RTL_TEXTENCODING_UTF8),
-xProps-getTitle());
+OUString 
aTitle(\xe5\x8e\xa6\xe9\x97\xa8\xe9\x92\xa8\xe4\xb8\x9a\xe8\x82\xa1\xe4\xbb\xbd\xe6\x9c\x89\xe9\x99\x90\xe5\x85\xac\xe5\x8f\xb8,
 30,
+RTL_TEXTENCODING_UTF8);
+CPPUNIT_ASSERT_EQUAL(aTitle, xProps-getTitle());
 uno::Referencebeans::XPropertySet 
xUDProps(xProps-getUserDefinedProperties(), uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(OUString(jay), getPropertyOUString(xUDProps, 
Operator));
+
+// fdo#80486 also check that the ftnsep doesn't insert paragraph breaks
+getParagraph(1, aTitle);
 }
 
 DECLARE_RTFIMPORT_TEST(testFdo47802, fdo47802.rtf)
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 6ea5d1d..68db15d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2049,6 +2049,8 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
 break;
 case RTF_PAR:
 {
+if (m_aStates.top().nDestinationState == DESTINATION_FOOTNOTESEPARATOR)
+break; // just ignore it - only thing we read in here is CHFTNSEP
 checkFirstRun();
 bool bNeedPap = m_bNeedPap;
 checkNeedPap();
@@ -2056,13 +2058,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
 runProps();
 if (!m_aStates.top().pCurrentBuffer)
 {
-if (m_aStates.top().nDestinationState == 
DESTINATION_FOOTNOTESEPARATOR)
-{
-static const sal_Unicode uCR = 0xd;
-Mapper().utext((const sal_uInt8*)uCR, 1);
-}
-else
-parBreak();
+parBreak();
 // Not in table? Reset max width.
 m_nCellxMax = 0;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-29 Thread Michael Stahl
 sw/qa/extras/rtfimport/data/fdo81033.rtf |   12 
 sw/qa/extras/rtfimport/rtfimport.cxx |   14 ++
 writerfilter/source/dmapper/DomainMapper.cxx |5 -
 3 files changed, 30 insertions(+), 1 deletion(-)

New commits:
commit 5dcf8fd9634c4d446bec3471b1fe0b43b61ed061
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jul 28 17:57:53 2014 +0200

fdo#81033: writerfilter: RTF import: fix tab stop inheritance from style

For RTF, the tab stops that are set directly on the paragraph are the
tab stops the paragraph has effectively; there is no equivalent of OOXML
w:tab w:val=clear w:pos=4536/ that would override a tab stop of
the applied style; that is done by simply omitting the tab stop.

It would perhaps be possible to implement something to synthesize a
NS_ooxml::LN_Value_ST_TabJc_clear in the RTF tokenizer for this case,
but it's simpler to just generally disable domain mapper's
InitTabStopFromStyle() for RTF.

Change-Id: I7b0581be8db19ffda81c8d1da290abf0a0f69529
(cherry picked from commit 7f6e26917d4aa682ed9c422c83b1df20d78177d2)
Reviewed-on: https://gerrit.libreoffice.org/10596
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/data/fdo81033.rtf 
b/sw/qa/extras/rtfimport/data/fdo81033.rtf
new file mode 100644
index 000..500aeb7
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo81033.rtf
@@ -0,0 +1,12 @@
+{\rtf1
+{\stylesheet
+{\s15\ql \tqc\tx4536\tqr\tx9072 header;}
+}
+
+\deftab709
+\pard\plain \s15\ql \tx3293\tlul\tx9072
+\tab
+\tab
+
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 7e5bd67..5a47fb7 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1325,6 +1325,20 @@ DECLARE_RTFIMPORT_TEST(testGroupshape_notext, 
groupshape-notext.rtf)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xGroupshape-getCount());
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo81033, fdo81033.rtf)
+{
+// Number of tabstops in the paragraph should be 2, was 3.
+uno::Sequencestyle::TabStop tabs(
+getProperty uno::Sequencestyle::TabStop (getParagraph(1), 
ParaTabStops));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), tabs.getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(5808), tabs[0].Position);
+CPPUNIT_ASSERT_EQUAL(style::TabAlign_LEFT, tabs[0].Alignment);
+CPPUNIT_ASSERT_EQUAL(sal_Unicode(0), tabs[0].FillChar);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(16002), tabs[1].Position);
+CPPUNIT_ASSERT_EQUAL(style::TabAlign_LEFT, tabs[1].Alignment);
+CPPUNIT_ASSERT_EQUAL(sal_Unicode('_'), tabs[1].FillChar);
+}
+
 DECLARE_RTFIMPORT_TEST(testFdo66565, fdo66565.rtf)
 {
 uno::Referencetext::XTextTablesSupplier xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index b854738..215bbaf 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1688,7 +1688,10 @@ void DomainMapper::sprmWithProps( Sprm rSprm, 
PropertyMapPtr rContext )
 case NS_ooxml::LN_CT_PPrBase_tabs:
 {
 // Initialize tab stop vector from style sheet
-if( !m_pImpl-IsStyleSheetImport() )
+// fdo#81033: for RTF, a tab stop is inherited from the style if it
+// is also applied to the paragraph directly, and cleared if it is
+// not applied to the paragraph directly = don't InitTabStopFromStyle
+if (!m_pImpl-IsStyleSheetImport()  !IsRTFImport())
 {
 uno::Any aValue = 
m_pImpl-GetPropertyFromStyleSheet(PROP_PARA_TAB_STOPS);
 uno::Sequence style::TabStop  aStyleTabStops;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-29 Thread Michael Stahl
 sw/qa/extras/rtfimport/rtfimport.cxx  |2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |9 +++--
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 4ccebccbe57f7dbc668e985f0db216d45d51061f
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jul 28 18:14:16 2014 +0200

(related: fdo#81033) writerfilter: default tab fill character is space

This avoids an ugly Character box in the dialog with a null byte in it.

Change-Id: Iee35a8e1bd6b57fb4eb8ae06722bd79ee1d5d8de
(cherry picked from commit c0b6aadedc9429eee4f4df85957e00e29ccb0c8f)
Reviewed-on: https://gerrit.libreoffice.org/10597
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 5a47fb7..cfa347b 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1333,7 +1333,7 @@ DECLARE_RTFIMPORT_TEST(testFdo81033, fdo81033.rtf)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(2), tabs.getLength());
 CPPUNIT_ASSERT_EQUAL(sal_Int32(5808), tabs[0].Position);
 CPPUNIT_ASSERT_EQUAL(style::TabAlign_LEFT, tabs[0].Alignment);
-CPPUNIT_ASSERT_EQUAL(sal_Unicode(0), tabs[0].FillChar);
+CPPUNIT_ASSERT_EQUAL(sal_Unicode(' '), tabs[0].FillChar);
 CPPUNIT_ASSERT_EQUAL(sal_Int32(16002), tabs[1].Position);
 CPPUNIT_ASSERT_EQUAL(style::TabAlign_LEFT, tabs[1].Alignment);
 CPPUNIT_ASSERT_EQUAL(sal_Unicode('_'), tabs[1].FillChar);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 049304d..3f62129 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -209,8 +209,13 @@ typedef std::stack AnchoredContext
TextContentStack;
 struct DeletableTabStop : public ::com::sun::star::style::TabStop
 {
 bool bDeleted;
-DeletableTabStop() :
-bDeleted( false ){}
+DeletableTabStop()
+: bDeleted(false)
+{
+// same defaults as SvxXMLTabStopContext_Impl
+FillChar = ' ';
+DecimalChar = ',';
+}
 DeletableTabStop( const ::com::sun::star::style::TabStop rTabStop ) :
 TabStop( rTabStop ),
 bDeleted( false ){}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa

2014-07-29 Thread Michael Stahl
 sw/qa/extras/ww8import/ww8import.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 24801a6a9c767459c7a2e5e4176c0a809f08422c
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 29 16:59:24 2014 +0200

sw: fix windows build after c20dcded64f85b464bf64bbf3e30ec4e4a8ee205

Change-Id: Ib768377459ed3ca2fe89bdd9f5b8d19d1ffb92cb

diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 5075b8f..33e0cfb 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -483,8 +483,6 @@ DECLARE_WW8IMPORT_TEST(testFdp80333, fdo80333.doc)
 CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_NONE, aShadow.Location);
 }
 
-#endif
-
 DECLARE_WW8IMPORT_TEST(testFloatingTableSectionColumns, 
floating-table-section-columns.doc)
 {
 OUString tableWidth = 
parseDump(/root/page[1]/body/section/column[2]/body/txt/anchored/fly/tab/infos/bounds,
 width);
@@ -492,6 +490,8 @@ DECLARE_WW8IMPORT_TEST(testFloatingTableSectionColumns, 
floating-table-section-
 CPPUNIT_ASSERT( tableWidth.toInt32()  1 );
 }
 
+#endif
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-25 Thread Michael Stahl
 sw/qa/extras/rtfimport/data/fdo79319.rtf   |   60 +
 sw/qa/extras/rtfimport/rtfimport.cxx   |   18 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 
 3 files changed, 80 insertions(+)

New commits:
commit ca88a0ea6ed7277e8522d83458e3cfb975fcfb7d
Author: Michael Stahl mst...@redhat.com
Date:   Fri Jul 18 11:55:07 2014 +0200

(related: fdo#79319): writerfilter: RTF import: don't lose shapes in header

With a horizontal rule, it's possible that there is no \par following it
in a header, so RemoveLastParagraph() will delete the paragraph where
the shape is anchored (and so the shape as well).  Avoid that by adding
an extra \par if there is no \par following a shape.

(cherry picked from commit 9aa80fcb291083dc2a396db3d1be756eb4a0e54b)

Change-Id: I4840417880c98203866c9dcde51627516618f2d0
Reviewed-on: https://gerrit.libreoffice.org/10389
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo79319.rtf 
b/sw/qa/extras/rtfimport/data/fdo79319.rtf
new file mode 100644
index 000..48f022b
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo79319.rtf
@@ -0,0 +1,60 @@
+{\rtf1
+{\header
+\par
+{\pict
+{\*\picprop\shplid1025
+{\sp
+{\sn shapeType}
+{\sv 1}
+}
+{\sp
+{\sn fFlipH}
+{\sv 0}
+}
+{\sp
+{\sn fFlipV}
+{\sv 0}
+}
+{\sp
+{\sn fillColor}
+{\sv 10070188}
+}
+{\sp
+{\sn fFilled}
+{\sv 1}
+}
+{\sp
+{\sn fLine}
+{\sv 0}
+}
+{\sp
+{\sn alignHR}
+{\sv 1}
+}
+{\sp
+{\sn dxHeightHR}
+{\sv 30}
+}
+{\sp
+{\sn fLayoutInCell}
+{\sv 1}
+}
+{\sp
+{\sn fStandardHR}
+{\sv 1}
+}
+{\sp
+{\sn fHorizRule}
+{\sv 1}
+}
+{\sp
+{\sn fLayoutInCell}
+{\sv 1}
+}
+}
+\picscalex864\picscaley6\piccropl0\piccropr0\piccropt0\piccropb0\picw1764\pich882\picwgoal1000\pichgoal500\wmetafile8\bliptag-1602651790\blipupi1752
+{\*\blipuid a07979727e802d02da96f878ba973054}
+01000903b70006001c0004000301080005000b0205000c021a00080704002e0118001c00fb02ceff90010440001254696d6573204e657720526f6d616e0004002d010400020101000500090200020d00320a2c0001000400080719002063160003001e000700fc02aca8990004002d0101000800fa020500ff0004002d0102000e002403050018000807180008070800fa0204002d0103000700fc02ff0004002d010400040027011c00fb021700bc020102022253797374656dde60e7770806080298030802200408025ae7833904002d0105000300}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 6f6dede..a6474fc 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -828,6 +828,24 @@ DECLARE_RTFIMPORT_TEST(testDppolyline, dppolyline.rtf)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xDraws-getCount());
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo79319, fdo79319.rtf)
+{
+// the thin horizontal rule was imported as a big fat rectangle
+uno::Referencedrawing::XShape xShape(getShape(1), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(100),
+getPropertysal_Int16(xShape, RelativeWidth));
+// FIXME the width/height numbers here are bogus; they should be 15238 / 53
+// (as they are when opening the file in a full soffice)
+#if 0
+CPPUNIT_ASSERT_EQUAL(sal_Int32(15238), xShape-getSize().Width);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(53), xShape-getSize().Height);
+CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER,
+getPropertysal_Int16(xShape, VertOrient));
+CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER,
+getPropertysal_Int16(xShape, HoriOrient));
+#endif
+}
+
 DECLARE_RTFIMPORT_TEST(testFdo56512, fdo56512.rtf)
 {
 uno::Referencetext::XTextFramesSupplier xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index ef5c241..1210aa1 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -5234,8 +5234,10 @@ int RTFDocumentImpl::popState()
 {
 resolvePict(true, m_pSdrImport-getCurrentShape());
 }
+m_bNeedFinalPar = true;
 break;
 case DESTINATION_SHAPE:
+m_bNeedFinalPar = true;
 m_bNeedCr = m_bNeedCrOrig;
 if (aState.aFrame.inFrame())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-07-23 Thread Michael Stahl
 sw/qa/extras/htmlexport/data/fdo81276.html |   21 +
 sw/qa/extras/htmlexport/htmlexport.cxx |   13 +
 sw/source/filter/html/htmlcss1.cxx |2 +-
 3 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit e934df1c0702c37a6fcee956f75250e8b736c3c5
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 22 23:34:40 2014 +0200

fdo#81276: sw: HTML import: fix inverted test in CSS import

(regression from 5089bdb234a93bcb62b597c18b8ab66048246b13)

Change-Id: I5b45c4c47ba66385b2b528b5a3039bda37b060d6
(cherry picked from commit 7dff37c65e08985b80ac79e13f5571819a8e739d)
Reviewed-on: https://gerrit.libreoffice.org/10477
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/htmlexport/data/fdo81276.html 
b/sw/qa/extras/htmlexport/data/fdo81276.html
new file mode 100644
index 000..653f6b1
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/fdo81276.html
@@ -0,0 +1,21 @@
+!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
+html lang=ru-ru 
+head
+meta http-equiv=content-type content=text/html; charset=UTF-8
+meta charset=utf-8
+style
+
+@page { size: 29.7cm 21cm;
+margin-left: 0.5cm;
+margin-right: 0.5cm;
+margin-top: 2cm;
+margin-bottom: 0.5cm
+}
+
+/style
+/head
+
+body
+
+/body
+/html
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index fc0caf4..5fd15ab 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -72,6 +72,19 @@ private:
 
 #define DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(TestName, filename) 
DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, HtmlExportTest)
 
+DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo81276, fdo81276.html)
+{
+uno::Referencecontainer::XNameAccess 
xPageStyles(getStyles(PageStyles));
+uno::Referencebeans::XPropertySet xStyle(xPageStyles-getByName(HTML), 
uno::UNO_QUERY);
+// some rounding going on here?
+CPPUNIT_ASSERT(abs(sal_Int32(29700) - getPropertysal_Int32(xStyle, 
Width))  10);
+CPPUNIT_ASSERT(abs(sal_Int32(21006) - getPropertysal_Int32(xStyle, 
Height))  10);
+CPPUNIT_ASSERT(abs(sal_Int32(500) - getPropertysal_Int32(xStyle, 
LeftMargin))  10);
+CPPUNIT_ASSERT(abs(sal_Int32(500) - getPropertysal_Int32(xStyle, 
RightMargin))  10);
+CPPUNIT_ASSERT(abs(sal_Int32(2000) - getPropertysal_Int32(xStyle, 
TopMargin))  10);
+CPPUNIT_ASSERT(abs(sal_Int32(500) - getPropertysal_Int32(xStyle, 
BottomMargin))  10);
+}
+
 DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo62336, fdo62336.docx)
 {
 // The problem was essentially a crash during table export as docx/rtf/html
diff --git a/sw/source/filter/html/htmlcss1.cxx 
b/sw/source/filter/html/htmlcss1.cxx
index 50519b1..e4628b6 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -1690,7 +1690,7 @@ void SwHTMLParser::NewStyle()
 sType = rOption.GetString();
 }
 
-bIgnoreRawData = !sType.getLength() 
+bIgnoreRawData = sType.getLength() 
  !sType.getToken(0,';').equalsAscii(sCSS_mimetype);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-16 Thread Miklos Vajna
 sw/qa/core/data/rtf/pass/abi2720.rtf   |  259 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |8 
 2 files changed, 264 insertions(+), 3 deletions(-)

New commits:
commit 326460072a42d849b46ab88b48580825bdb0bcc7
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Jun 19 17:49:29 2014 +0200

abi#2720 RTF import: handle non-graphic object after a graphic one

Change-Id: I9416b6e7cf3677006215fcbde458ed341c4e3e9e
(cherry picked from commit 3cab1adf19d553663685e8198f0ec3f258a37c36)
Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/core/data/rtf/pass/abi2720.rtf 
b/sw/qa/core/data/rtf/pass/abi2720.rtf
new file mode 100644
index 000..a337bda
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/abi2720.rtf
@@ -0,0 +1,259 @@
+{\rtf1
+\pard\plain \widctlpar\adjustright 
+\fs20\lang1031\cgrid 
+{\lang1024 
+{\shpgrp
+{\*\shpinst\shpleft0\shptop0\shpright14175\shpbottom9071\shpfhdr0\shpbxcolumn\shpbypara\shpwr3\shpwrk0\shpfblwtxt0\shpz1\shplid1032
+{\sp
+{\sn groupLeft}
+{\sv 1418}
+}
+{\sp
+{\sn groupTop}
+{\sv 1418}
+}
+{\sp
+{\sn groupRight}
+{\sv 15593}
+}
+{\sp
+{\sn groupBottom}
+{\sv 10489}
+}
+{\sp
+{\sn fFlipH}
+{\sv 0}
+}
+{\sp
+{\sn fFlipV}
+{\sv 0}
+}
+{\sp
+{\sn lidRegroup}
+{\sv 0}
+}
+{\shp
+{\*\shpinst\shplid1037
+{\sp
+{\sn relLeft}
+{\sv 2856}
+}
+{\sp
+{\sn relTop}
+{\sv 4008}
+}
+{\sp
+{\sn relRight}
+{\sv 3216}
+}
+{\sp
+{\sn relBottom}
+{\sv 4176}
+}
+{\sp
+{\sn fRelFlipH}
+{\sv 0}
+}
+{\sp
+{\sn fRelFlipV}
+{\sv 0}
+}
+{\sp
+{\sn shapeType}
+{\sv 0}
+}
+{\sp
+{\sn geoRight}
+{\sv 360}
+}
+{\sp
+{\sn geoBottom}
+{\sv 168}
+}
+{\sp
+{\sn shapePath}
+{\sv 4}
+}
+{\sp
+{\sn pVerticies}
+{\sv 
8;10;(168,168);(84,108);(0,48);(24,24);(48,0);(264,0);(312,24);(360,48);(336,108);(312,168)}
+}
+{\sp
+{\sn pSegmentInfo}
+{\sv 2;9;16384;44288;8193
+;44288;8193;44288;8193;44032;32768}
+}
+{\sp
+{\sn fFillOK}
+{\sv 1}
+}
+{\sp
+{\sn fFilled}
+{\sv 0}
+}
+{\sp
+{\sn lineEndArrowhead}
+{\sv 2}
+}
+{\sp
+{\sn lineEndArrowWidth}
+{\sv 1}
+}
+{\sp
+{\sn lineEndArrowLength}
+{\sv 0}
+}
+{\sp
+{\sn fArrowheadsOK}
+{\sv 1}
+}
+{\sp
+{\sn lidRegroup}
+{\sv 0}
+}
+}
+}
+}
+{\shprslt
+{\*\do\dobxcolumn\dobypara\dodhgt8193\dppolygon\dppolycount4\dpptx0\dppty0\dpptx14175\dppty0\dpptx14175\dppty9071\dpptx0\dppty9071\dpx0\dpy0\dpxsize14175\dpysize9071
+\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr255\dpfillbgcg255\dpfillbgcb255\dpfillpat1\dplinew15\dplinecor0\dplinecog0\dplinecob0}
+}
+}
+}
+{\page }
+{\lang1024 
+{\shpgrp
+{\*\shpinst\shpleft0\shptop0\shpright14175\shpbottom9071\shpfhdr0\shpbxcolumn\shpbypara\shpwr3\shpwrk0\shpfblwtxt0\shpz2\shplid1038
+{\sp
+{\sn groupLeft}
+{\sv 1418}
+}
+{\sp
+{\sn groupTop}
+{\sv 1418}
+}
+{\sp
+{\sn groupRight}
+{\sv 15593}
+}
+{\sp
+{\sn groupBottom}
+{\sv 10489}
+}
+{\sp
+{\sn fFlipH}
+{\sv 0}
+}
+{\sp
+{\sn fFlipV}
+{\sv 0}
+}
+{\sp
+{\sn lidRegroup}
+{\sv 0}
+}
+{\shp
+{\*\shpinst\shplid1041
+{\sp
+{\sn relLeft}
+{\sv 8506}
+}
+{\sp
+{\sn relTop}
+{\sv 5954}
+}
+{\sp
+{\sn relRight}
+{\sv 15593}
+}
+{\sp
+{\sn relBottom}
+{\sv 10489}
+}
+{\sp
+{\sn fRelFlipH}
+{\sv 0}
+}
+{\sp
+{\sn fRelFlipV}
+{\sv 0}
+}
+{\sp
+{\sn shapeType}
+{\sv 202}
+}
+{\sp
+{\sn lTxid}
+{\sv 458752}
+}
+{\sp
+{\sn hspNext}
+{\sv 1041}
+}
+{\sp
+{\sn fFitShapeToText}
+{\sv 0}
+}
+{\shptxt \pard\plain
+\pard\plain \widctlpar\adjustright \f1\fs20\lang1031\cgrid 
+{\f1\dn28 
+{\pict
+{\*\picprop\shplid1025
+{\sp
+{\sn shapeType}
+{\sv 75}
+}
+{\sp
+{\sn fFlipH}
+{\sv 0}
+}
+{\sp
+{\sn fFlipV}
+{\sv 0}
+}
+{\sp
+{\sn pictureActive}
+{\sv 0}
+}
+{\sp
+{\sn fillColor}
+{\sv 268435473}
+}
+{\sp
+{\sn fFilled}
+{\sv 0}
+}
+{\sp
+{\sn fLine}
+{\sv 0}
+}
+}
+\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw1870\pich1199\picwgoal1060\pichgoal680\wmetafile8\bliptag-1230064263\blipupi-1583
+{\*\blipuid b6aeb57956b0ad18d349a83cd13b7dd7}
+010009037001020015000500090204000201010005000102ff000500090204002e011800
+05003102010005000b0205000c024004a0060e0026060f0012000800c0ffbaff6006fa030b002606
+0f000c004d61746854797065e50009021500fb0280fe90010102001054696d6573204e657720526f6d61
+6e0004002d010900320a800234000100430001010900320a8002de0401004100ea001500fb0220ff9001
+0102001054696d6573204e657720526f6d616e2304002d0101000400f0010900320ad401d805010069003e000900
+320af5031503010069003e000900320aee00040301006e0070001000fb0280fe900100020002001053796d626f6c0002
+04002d010400f00101000900320a8002a40101003d00d3001000fb0220ff900100020002001053796d626f6c
+000204002d0101000400f0010900320af5036a0301003d007b000900320aee00830301002d007b001000fb02c0fd

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-16 Thread Michael Stahl
 sw/qa/core/data/rtf/pass/fdo80924.rtf  |   43 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   14 +++-
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |3 +
 writerfilter/source/rtftok/rtfsdrimport.cxx|   17 -
 4 files changed, 65 insertions(+), 12 deletions(-)

New commits:
commit 88cf46be3d1ad709cf822e209d0911d6a71f3222
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 15 23:36:51 2014 +0200

fdo#80924: writerfilter: RTF import: fix shapeType PictureFrame import

For shapeType PictureFrame, a default CustomShape was created and then
RTFDocumentImpl::resolvePict() crashes because it actually operates on a
previous shape, because in this special case RTFSdrImport::m_xShape
is never actually set to the new shape, so contains the previous one.

Also the new shape needs to be added to the draw-page, at least
otherwise the assertion of the supported service fails because
some SvxShape::mpObj weak-reference is dead?

This essentially reverts commit 3cab1adf19d553663685e8198f0ec3f258a37c36
(except for the added testcase, which was slightly different because
it did not have a pib property).

(regression from ba9b63d8101197d3fd8612193b1ca188271dfc1a)

(cherry picked from commit 083b2b1471fff9e75f4b27a8769f95b8a0ebf5a1)

Conflicts:
writerfilter/source/rtftok/rtfdocumentimpl.cxx

Change-Id: I6539c4286850dff2d8564006487cc765f1d117be
Reviewed-on: https://gerrit.libreoffice.org/10351
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/core/data/rtf/pass/fdo80924.rtf 
b/sw/qa/core/data/rtf/pass/fdo80924.rtf
new file mode 100644
index 000..cbaeb44
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/fdo80924.rtf
@@ -0,0 +1,43 @@
+{\rtf1\ansi\ansicpg1252\uc1
+{\*\generator Microsoft Word 11.0.5604;}
+{\info{\author Crystal Reports}{\doccomm Powered By Crystal}}
+\pard\plain {
+\lang1024\langfe1024\noproof\insrsid10428813
+{\shp{\*\shpinst\shpleft306\shptop16065\shpright11251\shpbottom16065\shpfhdr0\shpbxpage\shpbxignore\shpbypage\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz1\shplid1026
+{\sp{\sn shapeType}{\sv 20}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 
0}}{\sp{\sn lineWidth}{\sv 12700}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn posrelh}{\sv 
1}}{\sp{\sn posrelv}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 0}}{\sp{\sn 
fBehindDocument}{\sv 1}}
+{\sp{\sn fLayoutInCell}{\sv 0
+}
+\pard
+{\shp{\*\shpinst\shpleft4920\shptop850\shpright6264\shpbottom1858\shpfhdr0\shpbxpage\shpbxignore\shpbypage\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz2\shplid1027{\sp{\sn
 shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}
+{\sp{\sn pib}{\sv 
{\pict\picscalex30\picscaley30\piccropl0\piccropr0\piccropt0\piccropb0\picw7939\pich5953\picwgoal4501\pichgoal3375
+\jpegblip
+ffd8ffe000104a4649460001010100480048ffe10160457869664d4d002a00080009010e00020001010f00020006007a
+0112001500800112000300010001011a000500010096011b00050001009e012800030001000201310002
+000c00a687690004000100b243616e6f6e0043616e6f6e20506f77657253686f742041353130004800010048
+000147494d5020322e362e313109829a000500010124829d00050001012c882700030001900700043032
+31309003000200140134920a0005000101489286000700080150a007000430313030a00100030001
+0051eb8500040001323031313a30363a31322031393a32363a343611554e49434f444500ffdb0043000806060706
+05080707070909080a0c140d0c0b0b0c1912130f141d1a1f1e1d1a1c1c20242e2720222c231c1c2837292c30313434341f27393d38323c2e333432ffdb004301
+0909090c0b0c180d0d1832211c213232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232
+ffc0001108003c004003012200021101031101ffc4001a020301010004050203060100ffc400321201030302050302050500
+0102030004110512213151132241617106143242911523a1c1e17281b1d1f0ffc4001901010101010101010200030405ffc4
+001d1100020202030100010211213103225141ffda000c03010002110311003f007e1df6912a2c9e8372f27fdc509731bc571f731065
+8b1b668f180bcf0c3e3d7da99c6ca3cf24783ed5cbd1b6d8c91287232319ea3b7c57cc3d82cbdd5adecf62c9b9e50be6551d3e6975d7d49163f976ec47405985
+461fa6defa797c49e73264332a614007b64e71e993da8a6fa26d9b02459ca8f533e7fe055df1ad93d9e81edbea8831992270c060ed20d7351d76316ea6c9f6cb
+2379ba7007b50b7bf467dabaf812c881f254b9ca8f63eb54e816da6dd4d2e9978a535589cf926fc5d7b2907b7355d2ad076d0136b5746e15da77dcbd8fbf6ada
+0769144858052a0e3b8a51aae876a34b98ac31c4f1a92194739a274f995b4cb7594296f0c0233d7ff62a66d35686298dadc1958a89627e7aa9dbd7d0a9fed5c9
+19956c323608cf0738ff001553b9824dc5778f6f37a54cb89e4dfbcf9941f4c71dea1942c86ff1acc9340764817c2970bc9c72323f7a7aba84aea4e0678e

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-07-14 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo80905.rtf |   12 
 sw/qa/extras/rtfimport/rtfimport.cxx |   10 ++
 sw/source/core/unocore/unofield.cxx  |4 ++--
 3 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit a4fd1b2eafcc49486cb6a360d792f779659b68e2
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Jul 13 18:02:29 2014 +0200

fdo#80905 SwXTextFieldMasters::hasByName(): sync with SwXFieldMaster

Normally a mail merge field has a name like
css.text.fieldmaster.DataBase.datasource name.table name.column
name, however this isn't enforced: just
css.text.fieldmaster.DataBase.TEST is also accepted (even if its
semantics are ~undefined).

If SwXFieldMaster::setPropertyValue() allows setting such a field master
name, then SwXTextFieldMasters::hasByName() should not ignore such field
masters that have no dot in their name (TEST) or use Database, not
DataBase, otherwise (sane) client code in writerfilter ends up with
hasByName() returning false, but setPropertyValue() throwing an
exception, because the field master does have such a name.

This fixes DOCX/RTF import of multiple mail merge fields with the same
field command.

(cherry picked from commit d0a7a60cfa1a34ec7218656489b7463cd9eb1aad)

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

Change-Id: I498eabace25f8e466b3504ba13fa3060d4ba22da
Reviewed-on: https://gerrit.libreoffice.org/10269
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo80905.rtf 
b/sw/qa/extras/rtfimport/data/fdo80905.rtf
new file mode 100644
index 000..c088fe0
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo80905.rtf
@@ -0,0 +1,12 @@
+{\rtf1
+\pard\plain
+{\field
+{\*\fldinst MERGEFIELD  TEST \\* Upper  \\* MERGEFORMAT}
+{\fldrslt \'abTEST\'bb}
+}
+{\field
+{\*\fldinst MERGEFIELD  TEST \\* Upper  \\* MERGEFORMAT}
+{\fldrslt \'abTEST\'bb}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 4fd6941..6f6dede 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1709,6 +1709,16 @@ DECLARE_RTFIMPORT_TEST(testFdo73241, fdo73241.rtf)
 CPPUNIT_ASSERT_EQUAL(1, getPages());
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo80905, fdo80905.rtf)
+{
+uno::Referencetext::XTextFieldsSupplier xTextFieldsSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xFieldsAccess(xTextFieldsSupplier-getTextFields());
+uno::Referencecontainer::XEnumeration 
xFields(xFieldsAccess-createEnumeration());
+xFields-nextElement();
+// The problem was that there was only one field in the document, but 
there should be true.
+CPPUNIT_ASSERT_EQUAL(true, static_castbool(xFields-hasMoreElements()));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index 3043353..56be0c0 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2674,11 +2674,11 @@ static sal_uInt16 lcl_GetIdByName( OUString rName, 
OUString rTypeName )
 if( sUIName != sFldTypName )
 rName = comphelper::string::setToken(rName, 1, '.', sUIName);
 }
-else if (rTypeName == DataBase)
+else if (rTypeName.equalsIgnoreAsciiCase(DataBase))
 {
 rName = rName.copy(RTL_CONSTASCII_LENGTH(DataBase.));
 sal_uInt16 nDotCount = comphelper::string::getTokenCount(rName, '.');
-if( 2 = nDotCount )
+if( 1 = nDotCount )
 {
 // #i51815#
 rName = DataBase. + rName;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-07-13 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 8e08ec34ac5ad552709782b10fd309b78ed080f8
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Sat Jul 12 10:05:52 2014 +0200

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

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

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

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

Change-Id: Ib3cb4e904fdd33f215c81d7c02762a196f484b1b

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 147fb88..7cd6153 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -18,6 +18,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
 
@@ -462,6 +463,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 1ab57d5..e0100ae 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -4761,16 +4761,20 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 nId, 
const sal_uInt8* pData, sh
 
 _SetWW8_BRC(nBrcVer, aBrc, pData);
 
-Set1Border(aBoxItem, aBrc, BOX_LINE_TOP, 0, 0, true);
-Set1Border(aBoxItem, aBrc, BOX_LINE_BOTTOM, 0, 0, true);
-Set1Border(aBoxItem, aBrc, BOX_LINE_LEFT, 0, 0, true);
-Set1Border(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 );
+// Border style is none - no border, no shadow
+if( editeng::ConvertBorderStyleFromWord(aBrc.brcType()) != 
table::BorderLineStyle::NONE )
+{
+Set1Border(aBoxItem, aBrc, BOX_LINE_TOP, 0, 0, true);
+Set1Border(aBoxItem, aBrc, BOX_LINE_BOTTOM, 0, 0, true);
+Set1Border(aBoxItem, aBrc, BOX_LINE_LEFT, 0, 0, true);
+Set1Border(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 'libreoffice-4-3' - sw/qa

2014-07-13 Thread Andras Timar
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f847edf8fe057079bd3ac892564870872bfb0d56
Author: Andras Timar andras.ti...@collabora.com
Date:   Sun Jul 13 16:39:18 2014 +0200

Windows build fix

Change-Id: I583bdd69d08dd4e3b2f8454e9cee0fa0f3bc6b75

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 2d32dc1..8942d4c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3567,8 +3567,6 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79817,fdo79817.docx)
 assertXPath ( pXmlDoc, 
/w:document/w:body/w:p[3]/w:sdt/w:sdtPr/w:dataBinding, 
xpath,/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]);
 }
 
-#endif
-
 DECLARE_OOXMLEXPORT_TEST(testfdo80522,fdo80522.docx)
 {
xmlDocPtr pXmlDoc = parseExport([Content_Types].xml);
@@ -3622,6 +3620,8 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80898, fdo80898.docx)
 /word/embeddings/oleObject1.doc);
 }
 
+#endif
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-07-11 Thread Michael Stahl
 sw/qa/extras/ooxmlexport/data/fdo80410.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |   13 +
 sw/source/filter/ww8/docxattributeoutput.cxx |7 ++-
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 589b256452e729e05d9610f10fb2408810e56eb6
Author: Michael Stahl mst...@redhat.com
Date:   Thu Jul 10 22:47:27 2014 +0200

fdo#80410: sw: DOCX export: support DOCX embedded objects

(cherry picked from commit 3ffb06e76be9be7499f12973139949ddbf6297b9)
fdo#80410: let's add a unit test too...
(cherry picked from commit 46d9724369ba4f248eab0133d396bd8f6a4453c6)

Change-Id: Ifa9e12eee4139a9c9c5d17a349ff3511c62b3ea8
Reviewed-on: https://gerrit.libreoffice.org/10234
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/ooxmlexport/data/fdo80410.docx 
b/sw/qa/extras/ooxmlexport/data/fdo80410.docx
new file mode 100644
index 000..7660d84
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo80410.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 312d9d9..2d32dc1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3064,6 +3064,19 @@ DECLARE_OOXMLEXPORT_TEST(testFileWithInvalidImageLink, 
FileWithInvalidImageLink
 assertXPath(pXmlDoc, 
/w:document/w:body/w:p[2]/w:r[2]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1],
 embed, );
 }
 
+DECLARE_OOXMLEXPORT_TEST(testContentTypeDOCX, fdo80410.docx)
+{
+xmlDocPtr pXmlDoc = parseExport([Content_Types].xml);
+
+if (!pXmlDoc) // only test the export, not initial import
+   return;
+
+assertXPath(pXmlDoc,
+
/ContentType:Types/ContentType:Override[@PartName='/word/embeddings/oleObject1.docx'],
+ContentType,
+
application/vnd.openxmlformats-officedocument.wordprocessingml.document);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testContentTypeXLSM, fdo76098.docx)
 {
 xmlDocPtr pXmlDoc = parseExport([Content_Types].xml);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3b71536..98ed78b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4199,7 +4199,12 @@ void DocxAttributeOutput::WriteOLE( SwOLENode rNode, 
const Size rSize, const S
 sRelationType = 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;;
 sFileExtension = docm;
 }
-//Implementation for embedded Word 97-2003 document was missing
+else if (sProgID == Word.Document.12)
+{
+sMediaType = 
application/vnd.openxmlformats-officedocument.wordprocessingml.document;
+sRelationType = 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/package;;
+sFileExtension = docx;
+}
 else if( sProgID == Word.Document.8 )
 {
 sMediaType = application/msword;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-11 Thread Miklos Vajna
 sw/qa/extras/ooxmlexport/data/bnc884615.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx  |6 ++
 writerfilter/source/dmapper/DomainMapper.cxx |2 +-
 writerfilter/source/dmapper/OLEHandler.cxx   |   10 --
 writerfilter/source/dmapper/OLEHandler.hxx   |4 +++-
 5 files changed, 18 insertions(+), 4 deletions(-)

New commits:
commit 5360af296a67d40d9172a877a674f454eed8fa98
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Jul 4 16:38:40 2014 +0200

bnc#884615 VML import: import OLE objects in header with background wrapping

We already do this for drawingML shapes since commit
500343105707a9905f5198a4af6ad58fe307b7c2 (DOCX drawingML shape import:
always set Opaque, 2013-12-04), make the VML / OLE case behave the same
as well.

(cherry picked from commit 15c3a08b8b1e8060f9659c7bc98480a39d1802c5)

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

Change-Id: Ic22f1f3cfd325ccbbb9bd6fe9814553683e4de55
Reviewed-on: https://gerrit.libreoffice.org/10088
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/ooxmlexport/data/bnc884615.docx 
b/sw/qa/extras/ooxmlexport/data/bnc884615.docx
new file mode 100755
index 000..51ee5ca
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc884615.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index f3ebd43..142d087 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
@@ -1513,6 +1513,12 @@ DECLARE_OOXMLEXPORT_TEST(testPresetShape, 
preset-shape.docx)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(21600), aSubViewSize[0].Height);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testBnc884615, bnc884615.docx)
+{
+// The problem was that the shape in the header wasn't in the background.
+CPPUNIT_ASSERT_EQUAL(false, bool(getPropertysal_Bool(getShape(1), 
Opaque)));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 98286c3..b854738 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2211,7 +2211,7 @@ void DomainMapper::sprmWithProps( Sprm rSprm, 
PropertyMapPtr rContext )
 writerfilter::ReferenceProperties::Pointer_t pProperties = 
rSprm.getProps();
 if( pProperties.get( ) )
 {
-OLEHandlerPtr pOLEHandler( new OLEHandler );
+OLEHandlerPtr pOLEHandler( new OLEHandler(*this) );
 pProperties-resolve(*pOLEHandler);
 if ( pOLEHandler-isOLEObject( ) )
 {
diff --git a/writerfilter/source/dmapper/OLEHandler.cxx 
b/writerfilter/source/dmapper/OLEHandler.cxx
index 1976a13..a07b443 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 #include OLEHandler.hxx
+#include dmapper/DomainMapper.hxx
 #include PropertyMap.hxx
 #include GraphicHelpers.hxx
 
@@ -45,11 +46,12 @@ namespace dmapper {
 using namespace ::com::sun::star;
 
 
-OLEHandler::OLEHandler() :
+OLEHandler::OLEHandler(DomainMapper rDomainMapper) :
 LoggedProperties(dmapper_logger, OLEHandler),
 m_nDxaOrig(0),
 m_nDyaOrig(0),
-m_nWrapMode(1)
+m_nWrapMode(1),
+m_rDomainMapper(rDomainMapper)
 {
 }
 
@@ -104,6 +106,10 @@ void OLEHandler::lcl_attribute(Id rName, Value  rVal)
 
 try
 {
+// Shapes in the header or footer should be in the 
background.
+if (m_rDomainMapper.IsInHeaderFooter())
+xShapeProps-setPropertyValue(Opaque, 
uno::makeAny(false));
+
 m_aShapeSize = xTempShape-getSize();
 m_aShapePosition = xTempShape-getPosition();
 
diff --git a/writerfilter/source/dmapper/OLEHandler.hxx 
b/writerfilter/source/dmapper/OLEHandler.hxx
index 00b4d8a..9e22fc1 100644
--- a/writerfilter/source/dmapper/OLEHandler.hxx
+++ b/writerfilter/source/dmapper/OLEHandler.hxx
@@ -40,6 +40,7 @@ namespace com{ namespace sun{ namespace star{
 namespace writerfilter {
 namespace dmapper
 {
+class DomainMapper;
 /** Handler for OLE objects
  */
 class OLEHandler : public LoggedProperties
@@ -63,6 +64,7 @@ class OLEHandler : public LoggedProperties
 ::com::sun::star::uno::Reference ::com::sun::star::graphic::XGraphic  
m_xReplacement;
 
 ::com::sun::star::uno::Reference ::com::sun::star::io::XInputStream  
m_xInputStream;
+DomainMapper m_rDomainMapper;
 
 // Properties
 virtual void lcl_attribute(Id Name, Value  val) SAL_OVERRIDE;
@@ -73,7 +75,7 @@ class OLEHandler : public LoggedProperties
 const OUString sObjectName );
 
 public:
-OLEHandler();
+OLEHandler(DomainMapper 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa xmloff/source

2014-07-10 Thread Michael Stahl
 sw/qa/extras/odfexport/data/fdo79358.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx |   22 ++
 xmloff/source/text/XMLSectionExport.cxx  |2 +-
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit eb1ffce113e9110f87de25891f82b0a5752bd59c
Author: Michael Stahl mst...@redhat.com
Date:   Thu Jul 10 14:46:31 2014 +0200

fdo#79358: ODF export: fix index boolean property export

Due to inverted conditional, only the default values were exported, not
the non-default ones...

(regression from 8a81f542a6ca51305c53899b7e422cbaa432)

Change-Id: I0b1fc828230695709db49e1643801842d947403c
(cherry picked from commit d18308cf3b25ee30815bcaae73d49b5f5b8e734e)
Reviewed-on: https://gerrit.libreoffice.org/10194
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/odfexport/data/fdo79358.odt 
b/sw/qa/extras/odfexport/data/fdo79358.odt
new file mode 100644
index 000..a1d2572
Binary files /dev/null and b/sw/qa/extras/odfexport/data/fdo79358.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index 1284435..c0b42c0 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -11,9 +11,11 @@
 
 #if !defined(MACOSX)  !defined(WNT)
 #include com/sun/star/awt/Gradient.hpp
+#include com/sun/star/container/XIndexReplace.hpp
 #include com/sun/star/drawing/FillStyle.hpp
 #include com/sun/star/table/ShadowFormat.hpp
 #include com/sun/star/text/RelOrientation.hpp
+#include com/sun/star/text/XDocumentIndex.hpp
 #include com/sun/star/drawing/TextVerticalAdjust.hpp
 
 class Test : public SwModelTestBase
@@ -58,6 +60,26 @@ DECLARE_ODFEXPORT_TEST(testFdo38244, fdo38244.odt)
 CPPUNIT_ASSERT_EQUAL(OUString(M), getPropertyOUString(xPropertySet, 
Initials));
 }
 
+DECLARE_ODFEXPORT_TEST(testFdo79358, fdo79358.odt)
+{
+// the boolean properties of the index were not exported properly
+uno::Referencetext::XDocumentIndexesSupplier xIndexSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xIndexes(xIndexSupplier-getDocumentIndexes(), uno::UNO_QUERY);
+uno::Referencetext::XDocumentIndex xTOCIndex(xIndexes-getByIndex(0), 
uno::UNO_QUERY);
+uno::Referencebeans::XPropertySet xTOCProps(xTOCIndex, uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(false, getPropertybool(xTOCProps, 
CreateFromOutline));
+CPPUNIT_ASSERT_EQUAL(false, getPropertybool(xTOCProps, 
CreateFromMarks));
+CPPUNIT_ASSERT_EQUAL(true, getPropertybool(xTOCProps, 
CreateFromLevelParagraphStyles));
+// check that the source styles are preserved too while at it
+uno::Referencecontainer::XIndexReplace xLevels(
+getProperty uno::Referencecontainer::XIndexReplace (xTOCProps,
+LevelParagraphStyles));
+uno::SequenceOUString seq(1);
+seq[0] = Heading;
+CPPUNIT_ASSERT_EQUAL(uno::makeAny(seq), xLevels-getByIndex(1));
+CPPUNIT_ASSERT_EQUAL(uno::makeAny(uno::SequenceOUString()), 
xLevels-getByIndex(2));
+}
+
 DECLARE_ODFEXPORT_TEST(testFirstHeaderFooter, first-header-footer.odt)
 {
 // Test import and export of the header-first token.
diff --git a/xmloff/source/text/XMLSectionExport.cxx 
b/xmloff/source/text/XMLSectionExport.cxx
index adff8dd..fb5ee6f 100644
--- a/xmloff/source/text/XMLSectionExport.cxx
+++ b/xmloff/source/text/XMLSectionExport.cxx
@@ -1608,7 +1608,7 @@ void XMLSectionExport::ExportBoolean(
 
 // value = value ^ bInvert
 // omit if value == default
-if ( (bTmp != bInvert) == bDefault )
+if ( (bTmp != bInvert) != bDefault )
 {
 // export non-default value (since default is omitted)
 GetExport().AddAttribute(XML_NAMESPACE_TEXT,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-10 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/table-btlr-center.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |9 +++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   17 +++
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |7 ++
 writerfilter/source/dmapper/PropertyIds.cxx  |1 
 writerfilter/source/dmapper/PropertyIds.hxx  |1 
 6 files changed, 35 insertions(+)

New commits:
commit c65aa400296a1a1b59b43223bdac030c749e51e3
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jul 2 17:33:03 2014 +0200

bnc#865381 DOCX import: handle w:jc=center inside w:textDirection=btLr

(cherry picked from commit 3325e0f206ce864730468c3556ce06760042c157)
Reviewed-on: https://gerrit.libreoffice.org/10049
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

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

Change-Id: I102c70429457515b34e74cb8e82e1417e6276d1d
Reviewed-on: https://gerrit.libreoffice.org/10046
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx 
b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx
new file mode 100644
index 000..79cb53e
Binary files /dev/null and 
b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b55c64d..a0c09c9 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2193,6 +2193,15 @@ DECLARE_OOXMLIMPORT_TEST(testFdo80555, fdo80555.docx)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(245), xShape-getPosition().Y);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTableBtlrCenter, table-btlr-center.docx)
+{
+uno::Referencetext::XTextTablesSupplier xTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xTables(xTablesSupplier-getTextTables(), uno::UNO_QUERY);
+uno::Referencetext::XTextTable xTable(xTables-getByIndex(0), 
uno::UNO_QUERY);
+// Cell vertical alignment was NONE, should be CENTER.
+CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, 
getPropertysal_Int16(xTable-getCellByName(A2), VertOrient));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 57bbd32..a8650a5 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -28,6 +28,8 @@
 #include com/sun/star/text/HoriOrientation.hpp
 #include com/sun/star/text/RelOrientation.hpp
 #include com/sun/star/text/SizeType.hpp
+#include com/sun/star/text/VertOrientation.hpp
+#include com/sun/star/style/ParagraphAdjust.hpp
 #include dmapperLoggers.hxx
 #include TablePositionHandler.hxx
 
@@ -826,6 +828,21 @@ CellPropertyValuesSeq_t 
DomainMapperTableHandler::endTableGetCellProperties(Tabl
 }
 aCellIterator-get()-erase(PROP_HORIZONTAL_MERGE);
 }
+
+// Cell direction is not an UNO Property, either.
+const PropertyMap::const_iterator aCellDirectionIter = 
aCellIterator-get()-find(PROP_CELL_DIRECTION);
+if (aCellDirectionIter != aCellIterator-get()-end())
+{
+if (aCellDirectionIter-second.getValue().getsal_Int32() 
== 3)
+{
+// btLr, so map ParagraphAdjust_CENTER to 
VertOrientation::CENTER.
+uno::Referencebeans::XPropertySet 
xPropertySet((*m_pTableSeq)[nRow][nCell][0], uno::UNO_QUERY);
+if 
(xPropertySet-getPropertyValue(ParaAdjust).getsal_Int16() == 
style::ParagraphAdjust_CENTER)
+aCellIterator-get()-Insert(PROP_VERT_ORIENT, 
uno::makeAny(text::VertOrientation::CENTER));
+}
+aCellIterator-get()-erase(PROP_CELL_DIRECTION);
+}
+
 pSingleCellProperties[nCell] = 
aCellIterator-get()-GetPropertyValues();
 #ifdef DEBUG_DMAPPER_TABLE_HANDLER
 dmapper_logger-endElement();
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 98fa11a..8eaeccc 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -330,6 +330,13 @@ bool DomainMapperTableManager::sprm(Sprm  rSprm)
 case NS_ooxml::LN_CT_TcPrBase_textDirection:
 {
 TablePropertyMapPtr pPropMap( new TablePropertyMap );
+
+// Remember the cell direction, so later in
+// 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-07-09 Thread Luke Deller
 sw/qa/extras/ww8import/data/fdo77844.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx |   47 +++
 sw/source/filter/ww8/ww8par.cxx  |   15 -
 3 files changed, 60 insertions(+), 2 deletions(-)

New commits:
commit 025a9cf3a8ceba61d8424d7dcb029ab9607a0d73
Author: Luke Deller l...@deller.id.au
Date:   Sun Jul 6 23:19:18 2014 +1000

fix fdo#77844: header wrongly enabled from .doc

The LO page style needs page headers to be turned on if the
corresponding .doc file section has a left (=even) page header or a
first page header.

However this should not be triggered in the case where a first page
header is present but hidden due to the different first page header
option being disabled. This case is fixed by this commit.

Change-Id: If3de0df45378587fdbdecc6a091d2f4b60940b43
Reviewed-on: https://gerrit.libreoffice.org/10100
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com
(cherry picked from commit f312ef98de57a5926be67421395544bb9d41b809)
Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/ww8import/data/fdo77844.doc 
b/sw/qa/extras/ww8import/data/fdo77844.doc
new file mode 100755
index 000..cd7368d
Binary files /dev/null and b/sw/qa/extras/ww8import/data/fdo77844.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 270d665..147fb88 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -415,6 +415,53 @@ DECLARE_WW8IMPORT_TEST(testBnc875715, bnc875715.doc)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0), 
getPropertysal_Int32(xSections-getByIndex(0), SectionLeftMargin));
 }
 
+DECLARE_WW8IMPORT_TEST(testFdo77844, fdo77844.doc)
+{
+uno::Referencecontainer::XNameAccess pageStyles = 
getStyles(PageStyles);
+
+// get a page cursor
+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);
+
+// check that the first page has no header
+xCursor-jumpToFirstPage();
+OUString pageStyleName = getPropertyOUString(xCursor, PageStyleName);
+uno::Referencestyle::XStyle pageStyle(
+pageStyles-getByName(pageStyleName), uno::UNO_QUERY);
+bool headerIsOn = getPropertybool(pageStyle, HeaderIsOn);
+CPPUNIT_ASSERT(!headerIsOn);
+
+// check that the second page has a header
+xCursor-jumpToPage(2);
+pageStyleName = getPropertyOUString(xCursor, PageStyleName);
+pageStyle.set(
+pageStyles-getByName(pageStyleName), uno::UNO_QUERY);
+headerIsOn = getPropertybool(pageStyle, HeaderIsOn);
+CPPUNIT_ASSERT(headerIsOn);
+
+// check that the third page has a header
+xCursor-jumpToPage(3);
+pageStyleName = getPropertyOUString(xCursor, PageStyleName);
+pageStyle.set(
+pageStyles-getByName(pageStyleName), uno::UNO_QUERY);
+headerIsOn = getPropertybool(pageStyle, HeaderIsOn);
+CPPUNIT_ASSERT(headerIsOn);
+
+// check that the fourth page has no header
+// (#if'd out as this is not yet imported correctly)
+#if 0
+xCursor-jumpToPage(4);
+pageStyleName = getPropertyOUString(xCursor, PageStyleName);
+pageStyle.set(
+pageStyles-getByName(pageStyleName), uno::UNO_QUERY);
+headerIsOn = getPropertybool(pageStyle, HeaderIsOn);
+CPPUNIT_ASSERT(!headerIsOn);
+#endif
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 9224568..11fafbe 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2377,6 +2377,9 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const 
SwPageDesc *pPrev,
 long nLen;
 sal_uInt8 nNumber = 5;
 
+// This loops through the 6 flags WW8_{FOOTER,HEADER}_{ODD,EVEN,FIRST}
+// corresponding to bit fields in grpfIhdt indicating which
+// header/footer(s) are present in this section
 for( sal_uInt8 nI = 0x20; nI; nI = 1, nNumber-- )
 {
 if (nI  grpfIhdt)
@@ -2394,6 +2397,12 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const 
SwPageDesc *pPrev,
 = (nI  ( WW8_HEADER_EVEN | WW8_FOOTER_EVEN )) ? true: 
false;
 bool bUseFirst
 = (nI  ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST )) ? true: 
false;
+
+// If we are loading a first-page header/footer which is not
+// actually enabled in this section (it still needs to be
+// loaded as it may be inherited by a later section)
+bool bDisabledFirst = bUseFirst  !rSection.HasTitlePage();
+
 bool bFooter
 = (nI  ( WW8_FOOTER_EVEN | WW8_FOOTER_ODD | 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-07 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo73241.rtf   |8 
 sw/qa/extras/rtfimport/rtfimport.cxx   |6 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |4 
 3 files changed, 18 insertions(+)

New commits:
commit e262086784defe1c0f417eedf52b5de2db8e559e
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Jul 5 13:01:38 2014 +0200

fdo#73241 RTF import: ignore page break in tables

(cherry picked from commit fdc235126d6d73f47a5b56d453e1d3db8ba3e816)

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

Change-Id: Ibee9fec0f421b4c2ff3d45c861bc3fcfc97cbf15
Reviewed-on: https://gerrit.libreoffice.org/10092
Reviewed-by: Muthu Subramanian K muthus...@gmail.com
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/fdo73241.rtf 
b/sw/qa/extras/rtfimport/data/fdo73241.rtf
new file mode 100644
index 000..b919e25
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo73241.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+\pard\plain Before.\par
+\trowd \cellx4703\cellx9514\pard\plain\intbl
+{\page First cell\cell Second cell\cell }
+\pard\plain \intbl
+{\trowd \cellx4703\cellx9514\row }
+\pard\plain After.\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 4a5b844..4fd6941 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1703,6 +1703,12 @@ DECLARE_RTFIMPORT_TEST(testFontOverride, 
font-override.rtf)
 CPPUNIT_ASSERT_EQUAL(OUString(Arial), 
getPropertyOUString(getRun(getParagraph(1), 1), CharFontName));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo73241, fdo73241.rtf)
+{
+// This was 2, page break in table wasn't ignored.
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index d05ac5b..cc627a5 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2273,6 +2273,10 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
 break;
 case RTF_PAGE:
 {
+// Ignore page breaks inside tables.
+if (m_aStates.top().pCurrentBuffer == m_aTableBufferStack.back())
+break;
+
 // If we're inside a continuous section, we should send a section 
break, not a page one.
 RTFValue::Pointer_t pBreak = 
m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_type);
 // Unless we're on a title page.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-07 Thread Vinaya Mandke
 sw/qa/extras/ooxmlimport/data/fdo78939.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |   12 
 writerfilter/source/dmapper/NumberingManager.cxx |8 +---
 3 files changed, 13 insertions(+), 7 deletions(-)

New commits:
commit 933545f9bee6ed8d791ee4026cc0986702417ed8
Author: Vinaya Mandke vinaya.man...@synerzip.com
Date:   Fri Jun 6 14:12:48 2014 +0530

fdo#78939 [DOCX] Hang while opening due to incorrect modification of Style


http://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unosett.cxx#1884
Modifies the refernced style of the numbering rule to use the current 
numbering rule.
Actually the refernced style is not supposed to be modified.
As the numbering level formatonly uses that properties particular style,
which may or may not be a numbering style

For this Particular document the numbering format refers the Default 
Style (Normal).
Almost all of the styles in style.xml are based on it. Normal was modified,
and as a result the whole document was bulletized; Which caused the hang 
while opening

Removed the addition of style as a PARA_STYLE, as the properties of the
refernced style are already added in ListLevel::AddParaProperties

Signed-off-by: Michael Stahl mst...@redhat.com

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

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

Change-Id: I8cc143805a38613908d2e2cb4827882d4cf40a78
(cherry picked from commit e49d2b31fb2020d065b4ad940d1031d07b10f32b)
Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/ooxmlimport/data/fdo78939.docx 
b/sw/qa/extras/ooxmlimport/data/fdo78939.docx
new file mode 100644
index 000..2fc3198
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo78939.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index f2051fa..b55c64d 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2051,6 +2051,18 @@ DECLARE_OOXMLIMPORT_TEST(testFdo75722vml, 
fdo75722-vml.docx)
 CPPUNIT_ASSERT_EQUAL(sal_Int64(3100), nRot);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testFdo78939, fdo78939.docx)
+{
+// fdo#78939 : LO hanged while opening issue document
+
+// Whenever a para-style was applied to a Numbering format level,
+// LO incorrectly also changed the para-style..
+
+// check that file opens and does not hang while opening and also
+// check that an incorrect numbering style is not applied ...
+CPPUNIT_ASSERT_EQUAL(OUString(), getPropertyOUString(getParagraph(1), 
NumberingStyleName));
+}
+
 DECLARE_OOXMLIMPORT_TEST(testFdo75722dml, fdo75722-dml.docx)
 {
 uno::Referencedrawing::XShape xShape = getShape(1);
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 547c7b0..57159b9 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -647,13 +647,6 @@ void ListDef::CreateNumberingRules( DomainMapper rDMapper,
 
aLvlProps[sal::static_int_castsal_uInt32(aLvlProps.getLength()) - 1] = 
MAKE_PROPVAL( PROP_POSITION_AND_SPACE_MODE,
 sal_Int16( 
text::PositionAndSpaceMode::LABEL_ALIGNMENT ) );
 
-StyleSheetEntryPtr pParaStyle = pAbsLevel-GetParaStyle( );
-if( pParaStyle.get())
-{
-aLvlProps.realloc( aLvlProps.getLength() + 1 );
-
aLvlProps[sal::static_int_castsal_uInt32(aLvlProps.getLength()) - 1] = 
MAKE_PROPVAL( PROP_PARAGRAPH_STYLE_NAME,
-pParaStyle-sConvertedStyleName );
-}
 
 // Replace the numbering rules for the level
 m_xNumRules-replaceByIndex( nLevel, uno::makeAny( aLvlProps ) 
);
@@ -666,6 +659,7 @@ void ListDef::CreateNumberingRules( DomainMapper rDMapper,
 uno::Reference container::XIndexReplace  xOutlineRules =
 xOutlines-getChapterNumberingRules( );
 
+StyleSheetEntryPtr pParaStyle = pAbsLevel-GetParaStyle( );
 aLvlProps.realloc( aLvlProps.getLength() + 1 );
 
aLvlProps[sal::static_int_castsal_uInt32(aLvlProps.getLength()) - 1] = 
MAKE_PROPVAL( PROP_HEADING_STYLE_NAME,
 pParaStyle-sConvertedStyleName );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-07-05 Thread Jacobo Aragunde Pérez
 sw/qa/extras/ooxmlimport/data/fdo80555.docx   |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |8 
 writerfilter/source/dmapper/GraphicImport.cxx |4 +++-
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 1cacd685bf7c3230d3cdff964503adaedd025418
Author: Jacobo Aragunde Pérez jaragu...@igalia.com
Date:   Thu Jul 3 14:17:08 2014 +0200

fdo#80555: Set position of GraphicObjectShape objects correctly

Added a unit test for this issue.

(cherry picked from commit 816542b2bdd23423625ad4c2f0e706d5558b8ba9)
(cherry picked from commit c38be106ff1c1ff5e1b279e4ea2c710b524d23f1)

Conflicts:

sw/qa/extras/ooxmlimport/ooxmlimport.cxx

Change-Id: I13656f82c97e5bb8458cdc1cb47ddcc5f6d60330
Reviewed-on: https://gerrit.libreoffice.org/10056
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/ooxmlimport/data/fdo80555.docx 
b/sw/qa/extras/ooxmlimport/data/fdo80555.docx
new file mode 100644
index 000..a15bdc1
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo80555.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index f8f951f..f2051fa 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2173,6 +2173,14 @@ DECLARE_OOXMLIMPORT_TEST(testFootnote, footnote.docx)
 CPPUNIT_ASSERT(aFootnote.endsWith(bar));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testFdo80555, fdo80555.docx)
+{
+uno::Referencedrawing::XShape xShape = getShape(1);
+// Shape was wrongly placed at X=0, Y=0
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3318), xShape-getPosition().X);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(245), xShape-getPosition().Y);
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx 
b/writerfilter/source/dmapper/GraphicImport.cxx
index 11f5a73..6cd88a5 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -777,9 +777,11 @@ void GraphicImport::lcl_attribute(Id nName, Value rValue)
 m_pImpl-applyPosition(xShapeProps);
 
 uno::Referencelang::XServiceInfo 
xServiceInfo(m_xShape, uno::UNO_QUERY_THROW);
-if 
(xServiceInfo-supportsService(com.sun.star.drawing.GroupShape))
+if 
(xServiceInfo-supportsService(com.sun.star.drawing.GroupShape) ||
+
xServiceInfo-supportsService(com.sun.star.drawing.GraphicObjectShape))
 {
 // Position of the groupshape should be set after 
children have been added.
+// fdo#80555: also set position for graphic shapes 
here
 
m_xShape-setPosition(awt::Point(m_pImpl-nLeftPosition, 
m_pImpl-nTopPosition));
 }
 m_pImpl-applyRelativePosition(xShapeProps);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa

2014-07-01 Thread Matúš Kukan
 sw/qa/extras/ww8import/ww8import.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a502b3401fbfb0c71bda96e0165c3d3296705b76
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Wed Jun 25 09:45:07 2014 +0200

error: no matching function for call to 'assertEquals'

Change-Id: I0b87c2abeec30e9e4eab3ce488a5828b8a5b475d
Signed-off-by: Michael Meeks michael.me...@collabora.com

diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 6d0de33..270d665 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -412,7 +412,7 @@ DECLARE_WW8IMPORT_TEST(testBnc875715, bnc875715.doc)
 uno::Referencetext::XTextSectionsSupplier 
xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
 uno::Referencecontainer::XIndexAccess 
xSections(xTextSectionsSupplier-getTextSections(), uno::UNO_QUERY);
 // Was incorrectly set as -1270.
-CPPUNIT_ASSERT_EQUAL(0, getPropertysal_Int32(xSections-getByIndex(0), 
SectionLeftMargin));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0), 
getPropertysal_Int32(xSections-getByIndex(0), SectionLeftMargin));
 }
 
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-06-30 Thread Miklos Vajna
 sw/qa/extras/rtfexport/data/fdo80167.rtf |6 ++
 sw/qa/extras/rtfexport/rtfexport.cxx |6 ++
 sw/source/filter/ww8/docxexport.hxx  |2 ++
 sw/source/filter/ww8/rtfexport.hxx   |5 +
 sw/source/filter/ww8/wrtww8.hxx  |5 +
 sw/source/filter/ww8/ww8atr.cxx  |   13 ++---
 6 files changed, 34 insertions(+), 3 deletions(-)

New commits:
commit 124c2c3b015a7a9980dae67e1ca6844e66fa6258
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Jun 27 21:28:36 2014 +0200

fdo#80167 RTF export: don't loose page breaks

DOCX export tries to write accurately both w:br and
w:pageBreakBefore, while DOC/RTF prefers just the page break before
paragraph attribute. Given that these later two exporters are not
adapted to write their equivalent of w:br at all, add a virtual method
to determine if writing page breaks as page break before is preferred
or not, that'll give the expected RTF export result.

This conditionally reverts commit
a31fbb53dba76736b37213b98b64937f05929a67 (fdo#74566:DOCX: Preservation
w:br tag for Break to Next Page, 2014-02-06).

(cherry picked from commit 8100100298b877765e1781fb0eed285e82749ad1)

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

Change-Id: I4a5dd295b07739a570cd8cc6709561e64d031273
Reviewed-on: https://gerrit.libreoffice.org/9945
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/rtfexport/data/fdo80167.rtf 
b/sw/qa/extras/rtfexport/data/fdo80167.rtf
new file mode 100644
index 000..3aa9dd3
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo80167.rtf
@@ -0,0 +1,6 @@
+{\rtf1
+\pard\plain
+one\par
+\pard\page\par
+\pard two\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index de0ae10..e4ed685 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -644,6 +644,12 @@ DECLARE_RTFEXPORT_TEST(testFdo77600, fdo77600.rtf)
 CPPUNIT_ASSERT_EQUAL(OUString(Arial), 
getPropertyOUString(getRun(getParagraph(1), 3), CharFontName));
 }
 
+DECLARE_RTFEXPORT_TEST(testFdo80167, fdo80167.rtf)
+{
+// Problem was that after export, the page break was missing, so this was 
1.
+CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxexport.hxx 
b/sw/source/filter/ww8/docxexport.hxx
index 950db24..9ab2db9 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -124,6 +124,8 @@ public:
 
 virtual bool ignoreAttributeForStyles( sal_uInt16 nWhich ) const 
SAL_OVERRIDE;
 
+virtual bool PreferPageBreakBefore() const SAL_OVERRIDE { return false; }
+
 /// Guess the script (asian/western).
 virtual bool CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 
nWhich ) SAL_OVERRIDE;
 
diff --git a/sw/source/filter/ww8/rtfexport.hxx 
b/sw/source/filter/ww8/rtfexport.hxx
index aebb839..c384289 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -80,6 +80,11 @@ public:
 return false;
 }
 
+virtual bool PreferPageBreakBefore() const SAL_OVERRIDE
+{
+return true;
+}
+
 /// Guess the script (asian/western).
 virtual bool CollapseScriptsforWordOk(sal_uInt16 nScript, sal_uInt16 
nWhich) SAL_OVERRIDE;
 
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 9229fa5..b41abc4 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -645,6 +645,9 @@ public:
 /// Used to filter out attributes that can be e.g. written to .doc but not 
to .docx
 virtual bool ignoreAttributeForStyles( sal_uInt16 /*nWhich*/ ) const { 
return false; }
 
+/// If saving page break is preferred as a paragraph attribute (yes) or as 
a special character (no).
+virtual bool PreferPageBreakBefore() const = 0;
+
 /// Guess the script (asian/western).
 ///
 /// Sadly word does not have two different sizes for asian font size and
@@ -964,6 +967,8 @@ public:
 /// False for WW6, true for WW8.
 virtual bool SupportsUnicode() const SAL_OVERRIDE { return bWrtWW8; }
 
+virtual bool PreferPageBreakBefore() const SAL_OVERRIDE { return true; }
+
 virtual bool SupportsOneColumnBreak() const SAL_OVERRIDE { return false; }
 
 virtual bool FieldsQuoted() const SAL_OVERRIDE { return false; }
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 93c0682..ed6994b 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3765,9 +3765,16 @@ void AttributeOutputBase::FormatBreak( const 
SvxFmtBreakItem rBreak )
 break;
 
 case SVX_BREAK_PAGE_BEFORE: // PageBreak
-// From now on(fix for #i77900#) we prefer to save a page 
break as
-

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-06-29 Thread Michael Stahl
 sw/qa/extras/rtfexport/data/fdo78758.rtf |9 ++
 sw/qa/extras/rtfexport/rtfexport.cxx |   10 +++
 sw/source/filter/ww8/attributeoutputbase.hxx |2 -
 sw/source/filter/ww8/docxattributeoutput.cxx |2 -
 sw/source/filter/ww8/docxattributeoutput.hxx |2 -
 sw/source/filter/ww8/rtfattributeoutput.cxx  |   37 +--
 sw/source/filter/ww8/rtfattributeoutput.hxx  |9 --
 sw/source/filter/ww8/wrtw8esh.cxx|2 -
 sw/source/filter/ww8/wrtw8nds.cxx|4 +-
 sw/source/filter/ww8/wrtww8gr.cxx|2 -
 sw/source/filter/ww8/ww8attributeoutput.hxx  |2 -
 11 files changed, 47 insertions(+), 34 deletions(-)

New commits:
commit 04b5dd4d5080c5ffc0666dcfc62bda78170ba74c
Author: Michael Stahl mst...@redhat.com
Date:   Fri Jun 27 16:02:45 2014 +0200

fdo#78758: sw: RTF export: don't export multiple \fldrst for one hyperlink

Ensure that we export only one \fldresult per hyperlink by doing that in
StartURL() and EndURL(); the TextINetFormat() is called once per text
portion.  This shouldn't cause problems as there can't be anything
between the end of the \field group and the start of \fldresult anyway.

Replace the annoying call to EndURL() from EndRun() with a special case
in EndURL() to store things in the right buffer (hopefully).

(somehow this is regression from c4498251cb7181a9f272b0720f398597c0daef09)

Change-Id: I209ea7a384fb1cb5d1505a70ecc4a4536bbf26a2
(cherry picked from commit b8907bf3d3b37c686a414ffbbd2d732348aab5b9)
Reviewed-on: https://gerrit.libreoffice.org/9937
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/qa/extras/rtfexport/data/fdo78758.rtf 
b/sw/qa/extras/rtfexport/data/fdo78758.rtf
new file mode 100644
index 000..49c0502
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo78758.rtf
@@ -0,0 +1,9 @@
+{\rtf1\ansi
+\par \pard\plain
+{{\field{\*\fldinst HYPERLINK #__RefHeading___Toc264438068 }
+{\fldrslt {\langfe1024\rtlch \ltrch\loch\lang1024
+EE5E EeEEE5EE}{\scaps\langfe1024\rtlch \ltrch\loch\lang1024
+e}{\langfe1024\rtlch \ltrch\loch\lang1024
+\tab 46
+\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index ce91526..de0ae10 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -468,6 +468,16 @@ DECLARE_RTFEXPORT_TEST(testHyperlink, hyperlink.rtf)
 CPPUNIT_ASSERT_EQUAL(OUString(), 
getPropertyOUString(getRun(getParagraph(1), 3, !), HyperLinkURL));
 }
 
+DECLARE_RTFEXPORT_TEST(test78758, fdo78758.rtf)
+{
+CPPUNIT_ASSERT_EQUAL(OUString(#__RefHeading___Toc264438068),
+getPropertyOUString(getRun(getParagraph(2), 1, EE5E EeEEE5EE), 
HyperLinkURL));
+CPPUNIT_ASSERT_EQUAL(OUString(#__RefHeading___Toc264438068),
+getPropertyOUString(getRun(getParagraph(2), 2, e), 
HyperLinkURL));
+CPPUNIT_ASSERT_EQUAL(OUString(#__RefHeading___Toc264438068),
+getPropertyOUString(getRun(getParagraph(2), 3, \t46), 
HyperLinkURL));
+}
+
 DECLARE_RTFEXPORT_TEST(testTextFrameBorders, textframe-borders.rtf)
 {
 uno::Referencetext::XTextFramesSupplier xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx 
b/sw/source/filter/ww8/attributeoutputbase.hxx
index 5a25c86..361d90c 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -203,7 +203,7 @@ public:
 virtual bool StartURL( const OUString rUrl, const OUString rTarget ) = 0;
 
 /// Output URL end.
-virtual bool EndURL() = 0;
+virtual bool EndURL(bool isAtEndOfParagraph) = 0;
 
 virtual void FieldVanish( const OUString rTxt, ww::eField eType ) = 0;
 
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index a8b5fcd..dd76317 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1887,7 +1887,7 @@ bool DocxAttributeOutput::StartURL( const OUString rUrl, 
const OUString rTarge
 return true;
 }
 
-bool DocxAttributeOutput::EndURL()
+bool DocxAttributeOutput::EndURL(bool const)
 {
 m_closeHyperlinkInThisRun = true;
 if(m_startedHyperlink  m_hyperLinkAnchor !=   
m_hyperLinkAnchor.startsWith(_Toc))
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index 76d98cc..59fd6f8 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -190,7 +190,7 @@ public:
 virtual bool StartURL( const OUString rUrl, const OUString rTarget ) 
SAL_OVERRIDE;
 
 /// Output URL end.
-virtual bool EndURL() SAL_OVERRIDE;
+virtual bool EndURL(bool) SAL_OVERRIDE;
 
 virtual void FieldVanish( const OUString rTxt, ww::eField eType ) 
SAL_OVERRIDE;
 
diff --git 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-06-24 Thread Luboš Luňák
 sw/qa/extras/ww8import/data/bnc875715.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx  |8 ++
 sw/source/filter/ww8/ww8par.cxx   |   36 +++---
 3 files changed, 26 insertions(+), 18 deletions(-)

New commits:
commit ead8309b638b138d5ebb4a5bac36871479cacaab
Author: Luboš Luňák l.lu...@collabora.com
Date:   Tue Jun 24 14:14:14 2014 +0200

fix reading of section margins (bnc#875715)

The reason the section ended up with incorrect margins was because
that is computed as 'page margin' - 'section offset', and the order
of setting these up was backwards: First InsertSection() created
the section using the page margin of the old page, and only afterwards
SetSwFmtPageDesc() set the page margin that should be used.

Change-Id: I18ddcb0b5928879a2297b6caca766eab979abd45
(cherry picked from commit 7637f765cf2f8f65aec5490bd36bf4c745d2cfc6)
Reviewed-on: https://gerrit.libreoffice.org/9878
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/ww8import/data/bnc875715.doc 
b/sw/qa/extras/ww8import/data/bnc875715.doc
new file mode 100644
index 000..af15e14
Binary files /dev/null and b/sw/qa/extras/ww8import/data/bnc875715.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 8ef83c1..6d0de33 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -407,6 +407,14 @@ DECLARE_WW8IMPORT_TEST(testBnc863018, bnc863018.doc)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(5002), getPropertysal_Int32(xTable, 
TopMargin));
 }
 
+DECLARE_WW8IMPORT_TEST(testBnc875715, bnc875715.doc)
+{
+uno::Referencetext::XTextSectionsSupplier 
xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xSections(xTextSectionsSupplier-getTextSections(), uno::UNO_QUERY);
+// Was incorrectly set as -1270.
+CPPUNIT_ASSERT_EQUAL(0, getPropertysal_Int32(xSections-getByIndex(0), 
SectionLeftMargin));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 4712493..27274f2 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4519,24 +4519,6 @@ void wwSectionManager::InsertSegments()
 aSectPaM.GetPoint()-nContent.Assign(
 aSectPaM.GetCntntNode(), 0);
 
-// End getting the bounds of this section, quite a job eh?
-SwSectionFmt *pRet = InsertSection(aSectPaM, *aIter);
-// The last section if continuous is always unbalanced
-if (pRet)
-{
-// Set the columns to be UnBalanced if that compatability 
option is set
-if (mrReader.pWDop-fNoColumnBalance)
-pRet-SetFmtAttr(SwFmtNoBalancedColumns(true));
-else
-{
-// Otherwise set to unbalanced if the following section is
-// not continuous, (which also means that the last section
-// is unbalanced)
-if (aNext == aEnd || !aNext-IsContinuous())
-pRet-SetFmtAttr(SwFmtNoBalancedColumns(true));
-}
-}
-
 bool bHasOwnHdFt = false;
 /*
  In this nightmare scenario the continuous section has its own
@@ -4582,6 +4564,24 @@ void wwSectionManager::InsertSegments()
 aIter-mpPage = pOrig;
 }
 }
+
+// End getting the bounds of this section, quite a job eh?
+SwSectionFmt *pRet = InsertSection(aSectPaM, *aIter);
+// The last section if continuous is always unbalanced
+if (pRet)
+{
+// Set the columns to be UnBalanced if that compatability 
option is set
+if (mrReader.pWDop-fNoColumnBalance)
+pRet-SetFmtAttr(SwFmtNoBalancedColumns(true));
+else
+{
+// Otherwise set to unbalanced if the following section is
+// not continuous, (which also means that the last section
+// is unbalanced)
+if (aNext == aEnd || !aNext-IsContinuous())
+pRet-SetFmtAttr(SwFmtNoBalancedColumns(true));
+}
+}
 }
 
 if (pTxtNd)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-06-16 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/footnote.docx   |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   10 ++
 writerfilter/source/dmapper/DomainMapper.cxx  |4 +++-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 +++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |2 ++
 5 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit e1af737ef9c1ae599cf9758d199edfd7e16da62a
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jun 11 12:39:33 2014 +0200

DOCX import: fix additional empty paragraphs around footnote text

Regression from commit abe1e852a232e3bdab7b9177d099fe3929f5a4aa (handle
properly page breaks even if a page contains only a frame (fdo#55381),
2014-04-21), DomainMapper::lcl_endSectionGroup() inserted an empty
paragraph before and after the real footnote text. Disable addition of
the dummy paragraph for footnotes.

(cherry picked from commit 4d120b6ab181f530d3fedc963b1c6ec777f2608a)
Signed-off-by: Luboš Luňák l.lu...@collabora.com

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

Change-Id: I6e1954c9bd5520ac284d66244ce1c9004e970305

diff --git a/sw/qa/extras/ooxmlimport/data/footnote.docx 
b/sw/qa/extras/ooxmlimport/data/footnote.docx
new file mode 100644
index 000..f5c94bd
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/footnote.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 90d2680..f8f951f 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2163,6 +2163,16 @@ DECLARE_OOXMLIMPORT_TEST(testBnc875718, bnc875718.docx)
 CPPUNIT_ASSERT_EQUAL( OUString( Text\n ), text-getString());
 }
 
+DECLARE_OOXMLIMPORT_TEST(testFootnote, footnote.docx)
+{
+uno::Referencetext::XFootnotesSupplier xFootnotesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xFootnotes(xFootnotesSupplier-getFootnotes(), uno::UNO_QUERY);
+uno::Referencetext::XTextRange xFootnote(xFootnotes-getByIndex(0), 
uno::UNO_QUERY);
+OUString aFootnote = xFootnote-getString();
+// Ensure there are no additional newlines after bar.
+CPPUNIT_ASSERT(aFootnote.endsWith(bar));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 0a958d4..98286c3 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2498,7 +2498,9 @@ void DomainMapper::lcl_endSectionGroup()
 {
 m_pImpl-CheckUnregisteredFrameConversion();
 m_pImpl-ExecuteFrameConversion();
-if(m_pImpl-GetIsFirstParagraphInSection())
+// First paragraph in a footnote doesn't count: that would create
+// additional paragraphs before and after the real footnote content.
+if(m_pImpl-GetIsFirstParagraphInSection()  
!m_pImpl-IsInFootOrEndnote())
 {
 // This section has no paragraph at all (e.g. they are all 
actually in a frame).
 // If this section has a page break, there would be nothing to 
apply to the page
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 5078760..bdad3b1 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -173,6 +173,7 @@ DomainMapper_Impl::DomainMapper_Impl(
 m_bInAnyTableImport( false ),
 m_bInHeaderFooterImport( false ),
 m_bDiscardHeaderFooter( false ),
+m_bInFootOrEndnote(false),
 m_bLineNumberingSet( false ),
 m_bIsInFootnoteProperties( false ),
 m_bIsCustomFtnMark( false ),
@@ -1547,6 +1548,7 @@ void DomainMapper_Impl::PopPageHeaderFooter()
 
 void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
 {
+m_bInFootOrEndnote = true;
 try
 {
 // Redlines outside the footnote should not affect footnote content
@@ -1717,6 +1719,7 @@ void DomainMapper_Impl::PopFootOrEndnote()
 return;
 }
 m_aRedlines.pop();
+m_bInFootOrEndnote = false;
 }
 
 
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 74ff784..049304d 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -359,6 +359,7 @@ private:
 boolm_bInAnyTableImport; //in import of fonts, 
styles, lists or lfos
 boolm_bInHeaderFooterImport;
 boolm_bDiscardHeaderFooter;
+boolm_bInFootOrEndnote;
 
 boolm_bLineNumberingSet;
 boolm_bIsInFootnoteProperties;
@@ -571,6 +572,7 @@ public:
 
 void PushFootOrEndnote( bool 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-06-11 Thread Rohit Deshmukh
 sw/qa/extras/ooxmlexport/data/fdo79817.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |9 +
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 73d1c167c029594eb0be8eb24c065de39b9f69ab
Author: Rohit Deshmukh rohit.deshm...@synerzip.com
Date:   Mon Jun 9 15:41:57 2014 +0530

fdo#79817:Fix for corruption having databinding have duplicates attributes

File contains SDT content, in which after export databinding have duplicate 
attribute.

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

Change-Id: Ibe828964c054bdd5a63b5c0c903bc7441d953d72
(cherry picked from commit 88f84eb1b0eebbb7e0a072f1e7001a9207ebbe9e)
Reviewed-on: https://gerrit.libreoffice.org/9729
Reviewed-by: Jacobo Aragunde Pérez jaragu...@igalia.com
Tested-by: Jacobo Aragunde Pérez jaragu...@igalia.com

diff --git a/sw/qa/extras/ooxmlexport/data/fdo79817.docx 
b/sw/qa/extras/ooxmlexport/data/fdo79817.docx
new file mode 100644
index 000..4194c43
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo79817.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 668caa3..9a19485 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3489,6 +3489,15 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79822, fdo79822.docx)
 return;
 }
 
+DECLARE_OOXMLEXPORT_TEST(testfdo79817,fdo79817.docx)
+{
+xmlDocPtr pXmlDoc = parseExport(word/document.xml);
+if (!pXmlDoc)
+return;
+assertXPath ( pXmlDoc, 
/w:document/w:body/w:p[3]/w:sdt/w:sdtPr/w:dataBinding, 
storeItemID,{9222E47B-A68B-4AEB-9855-21C912B9D3D2});
+assertXPath ( pXmlDoc, 
/w:document/w:body/w:p[3]/w:sdt/w:sdtPr/w:dataBinding, 
xpath,/ns0:properties[1]/documentManagement[1]/ns2:Responsible_x0020_Officer_x0020_Title[1]);
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3eba470..5cfda6e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7423,7 +7423,7 @@ void DocxAttributeOutput::CharGrabBag( const 
SfxGrabBagItem rItem )
rtl::OUStringToOString( sValue, 
RTL_TEXTENCODING_UTF8 ).getStr() );
 }
 }
-else if (aPropertyValue.Name == ooxml:CT_SdtPr_dataBinding)
+else if (aPropertyValue.Name == ooxml:CT_SdtPr_dataBinding 
 m_pRunSdtPrDataBindingAttrs == NULL)
 {
 uno::Sequencebeans::PropertyValue aGrabBag;
 aPropertyValue.Value = aGrabBag;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-06-11 Thread Ravindra Vidhate
 sw/qa/extras/ooxmlexport/data/fdo79062.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |   13 +
 sw/source/filter/ww8/docxattributeoutput.cxx |5 +
 sw/source/filter/ww8/docxexport.hxx  |6 +++---
 4 files changed, 17 insertions(+), 7 deletions(-)

New commits:
commit 37f93938ad4520cebf1e9cca7859cbf77ab5f766
Author: Ravindra Vidhate ravindra.vidh...@synerzip.com
Date:   Thu May 22 15:39:25 2014 +0530

fdo#79062 File having Footnote with Text Effect got corrupted after RT

When we do the export of the file, In the footnotes.xml,
 the w14 namespaces were not being added.

This issue exists for EndNotes as well.

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

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

Change-Id: I6494bbf1beaa0666743d9c1bb85a64f8bda20398

diff --git a/sw/qa/extras/ooxmlexport/data/fdo79062.docx 
b/sw/qa/extras/ooxmlexport/data/fdo79062.docx
new file mode 100644
index 000..181ea72
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo79062.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 9a19485..4d02d31 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1670,6 +1670,19 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70812, fdo70812.docx)
 getParagraph(1, Sample pages document.);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testFDO79062, fdo79062.docx)
+{
+xmlDocPtr pXmlFootNotes = parseExport(word/footnotes.xml);
+if (!pXmlFootNotes)
+return;
+assertXPath(pXmlFootNotes, /w:footnotes, Ignorable, w14 wp14);
+
+xmlDocPtr pXmlEndNotes = parseExport(word/endnotes.xml);
+if (!pXmlEndNotes)
+return;
+assertXPath(pXmlEndNotes, /w:endnotes, Ignorable, w14 wp14);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testPgMargin, testPgMargin.docx)
 {
 xmlDocPtr pXmlDoc = parseExport();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5cfda6e..a8b5fcd 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5970,10 +5970,7 @@ void DocxAttributeOutput::FootnotesEndnotes( bool 
bFootnotes )
 sal_Int32 nBody = bFootnotes? XML_footnotes: XML_endnotes;
 sal_Int32 nItem = bFootnotes? XML_footnote:  XML_endnote;
 
-m_pSerializer-startElementNS( XML_w, nBody,
-FSNS( XML_xmlns, XML_w ), 
http://schemas.openxmlformats.org/wordprocessingml/2006/main;,
-FSNS( XML_xmlns, XML_r ), 
http://schemas.openxmlformats.org/officeDocument/2006/relationships;,
-FSEND );
+m_pSerializer-startElementNS( XML_w, nBody, 
m_rExport.MainXmlNamespaces(m_pSerializer) );
 
 sal_Int32 nIndex = 0;
 
diff --git a/sw/source/filter/ww8/docxexport.hxx 
b/sw/source/filter/ww8/docxexport.hxx
index cd5450e..950db24 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -246,9 +246,6 @@ private:
 /// Write word/embeddings/Worksheet[n].xlsx
 void WriteEmbeddings();
 
-/// All xml namespaces to be used at the top of any text .xml file (main 
doc, headers, footers,...)
-sax_fastparser::XFastAttributeListRef MainXmlNamespaces( 
sax_fastparser::FSHelperPtr serializer );
-
 /// Get background color of the document, if there is one.
 boost::optionalconst SvxBrushItem* getBackground();
 
@@ -256,6 +253,9 @@ private:
 bool isMirroredMargin();
 
 public:
+/// All xml namespaces to be used at the top of any text .xml file (main 
doc, headers, footers,...)
+sax_fastparser::XFastAttributeListRef MainXmlNamespaces( 
sax_fastparser::FSHelperPtr serializer );
+
 /// FIXME this is temporary, remotely reminding the method of the same
 /// name in WW8Export.
 void WriteMainText();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-06-10 Thread PriyankaGaikwad
 sw/qa/extras/ooxmlexport/data/fdo79822.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx|   10 ++
 sw/source/filter/ww8/docxsdrexport.cxx  |4 +++-
 3 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 713c639ce5ba6371e9c0d9ff51be7cf4c68d3d4c
Author: PriyankaGaikwad priyanka.gaik...@synerzip.com
Date:   Tue Jun 10 14:53:40 2014 +0530

fdo#79822 : Crash:LO Crashes while Saving the DOCX containing smartart

Decription :
- Docx file contain smartart and it was created in MS word 2007.
- MS word 2007 does not create any drawing.xml for smartart
- So in DocxSdrExport::writeDiagram() diagramDrawing was not set in this 
case.
- File crashing at diagramDrawing[0] = drawingDom as diagramDrawing is 
empty.

Change-Id: I6bc38e702f731ad8074b562572fd50f2e29a41b7
Reviewed-on: https://gerrit.libreoffice.org/9706
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com
(cherry picked from commit 178550923533b7c015e29d957a2fc3857ba73eb3)

diff --git a/sw/qa/extras/ooxmlexport/data/fdo79822.docx 
b/sw/qa/extras/ooxmlexport/data/fdo79822.docx
new file mode 100644
index 000..2844671
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo79822.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index fd98235..a87ddef 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3468,6 +3468,16 @@ DECLARE_OOXMLEXPORT_TEST(testWordArtWithinDraingtool, 
testWordArtWithinDraingto
 
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testfdo79822, fdo79822.docx)
+{
+/* File getting crash while saving in LO.
+ * The Docx contain smartart and the file was created in ms word 2007
+ */
+xmlDocPtr pXmlDoc = parseExport(word/document.xml);
+if (!pXmlDoc)
+return;
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 29c1195..2e77418 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -945,12 +945,14 @@ void DocxSdrExport::writeDiagram(const SdrObject* 
sdrObject, const SwFrmFmt rFr
 else if (propName == OOXColor)
 propList[nProp].Value = colorDom;
 else if (propName == OOXDrawing)
+{
 propList[nProp].Value = diagramDrawing;
+diagramDrawing[0] = drawingDom; // if there is OOXDrawing 
property then set drawingDom here only.
+}
 else if (propName == OOXDiagramDataRels)
 propList[nProp].Value = xDataRelSeq;
 }
 
-diagramDrawing[0] = drawingDom;
 // check that we have the 4 mandatory XDocuments
 // if not, there was an error importing and we won't output anything
 if (!dataDom.is() || !layoutDom.is() || !styleDom.is() || !colorDom.is())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-06-10 Thread Ravindra Vidhate
 sw/qa/extras/ooxmlexport/data/fdo78887.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |   11 +++
 sw/source/filter/ww8/docxattributeoutput.cxx |   11 ++-
 3 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 637a96d1e7875043c28a93c9a543f33a862497cb
Author: Ravindra Vidhate ravindra.vidh...@synerzip.com
Date:   Wed May 21 14:54:35 2014 +0530

fdo#78887 w:br tag is not being preserved after export.

When we have w:br tag continuous like in the following cases...

Title: Superstition\v\vComposer: Stevie Wonder\v\v
or \vLyrics: \v

where \n is internally replaced by \v LO.

Before text \v or after text multiple \v is not preserved.

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

(cherry picked from commit 8555c24e069dc00071eaad23c711f1d1375e5afc)
Signed-off-by: Michael Stahl mst...@redhat.com

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

Change-Id: I2a6d0a7d2382dfbc2f0ab04f150653c9b17bbfd1

diff --git a/sw/qa/extras/ooxmlexport/data/fdo78887.docx 
b/sw/qa/extras/ooxmlexport/data/fdo78887.docx
new file mode 100644
index 000..db92fe4
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78887.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index a87ddef..668caa3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3180,6 +3180,17 @@ DECLARE_OOXMLEXPORT_TEST(testFDO77890 , fdo77890.docx)
 assertXPath(pXmlDoc, /w:document/w:body/w:p[2]/w:r[2]/w:br, type, 
page);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testFDO78887, fdo78887.docx)
+{
+xmlDocPtr pXmlDoc = parseExport(word/document.xml);
+if (!pXmlDoc)
+return;
+
+assertXPath(pXmlDoc, /w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[1], 1);
+assertXPathContent(pXmlDoc, 
/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:t[1], Lyrics: );
+assertXPath(pXmlDoc, /w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:br[2], 1);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testNumberedList,NumberedList.docx)
 {
 //fdo74150:In document.xml, for pStyle = NumberedList1, iLvl and numId 
was not preserved
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index f16fdf6..3eba470 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1680,6 +1680,8 @@ void DocxAttributeOutput::RunText( const OUString rText, 
rtl_TextEncoding /*eCh
 if ( m_pRedlineData  m_pRedlineData-GetType() == 
nsRedlineType_t::REDLINE_DELETE )
 nTextToken = XML_delText;
 
+sal_Unicode prevUnicode = *pBegin;
+
 for ( const sal_Unicode *pIt = pBegin; pIt  pEnd; ++pIt )
 {
 switch ( *pIt )
@@ -1687,20 +1689,26 @@ void DocxAttributeOutput::RunText( const OUString 
rText, rtl_TextEncoding /*eCh
 case 0x09: // tab
 impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt );
 m_pSerializer-singleElementNS( XML_w, XML_tab, FSEND );
+prevUnicode = *pIt;
 break;
 case 0x0b: // line break
 {
-if (impl_WriteRunText( m_pSerializer, nTextToken, pBegin, 
pIt ))
+if (impl_WriteRunText( m_pSerializer, nTextToken, pBegin, 
pIt ) || (prevUnicode == *pIt))
+{
 m_pSerializer-singleElementNS( XML_w, XML_br, FSEND );
+prevUnicode = *pIt;
+}
 }
 break;
 case 0x1E: //non-breaking hyphen
 impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt );
 m_pSerializer-singleElementNS( XML_w, XML_noBreakHyphen, 
FSEND );
+prevUnicode = *pIt;
 break;
 case 0x1F: //soft (on demand) hyphen
 impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt );
 m_pSerializer-singleElementNS( XML_w, XML_softHyphen, FSEND );
+prevUnicode = *pIt;
 break;
 default:
 if ( *pIt  0x0020 ) // filter out the control codes
@@ -1708,6 +1716,7 @@ void DocxAttributeOutput::RunText( const OUString rText, 
rtl_TextEncoding /*eCh
 impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt 
);
 OSL_TRACE( Ignored control code %x in a text run., *pIt 
);
 }
+prevUnicode = *pIt;
 break;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-06-02 Thread Miklos Vajna
 sw/qa/core/data/rtf/pass/fdo79384.rtf  |5 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |7 ++-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit b7b3035ff14ba78ee193a0d5e83c9b028bf06b84
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jun 2 20:14:16 2014 +0200

fdo#79384 RTF import: allow { without } in style names

This is not valid, but LO 3.4 supported it, so add a workaround...

(cherry picked from commit 6092e2eba3f74c9632f7862b2368b0fcf7732f85)

Change-Id: Ib8eefdf41fe9801db6f7e5873eaa1436518912fb

diff --git a/sw/qa/core/data/rtf/pass/fdo79384.rtf 
b/sw/qa/core/data/rtf/pass/fdo79384.rtf
new file mode 100644
index 000..84875a9
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/fdo79384.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+{\stylesheet
+{\*\cs35\snext35\hich\af5\dbch\af5\loch\f5 „M„p„‚„{„u„‚„ „ƒ„„y„ƒ„{„p;}
+}
+\par }
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index d66b668..6869014 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -956,7 +956,12 @@ int RTFDocumentImpl::resolveChars(char ch)
 
 bool bUnicodeChecked = false;
 bool bSkipped = false;
-while (!Strm().IsEof()  (m_aStates.top().nInternalState == INTERNAL_HEX 
|| (ch != '{'  ch != '}'  ch != '\\')))
+
+// Workaround for buggy input: if we're inside a style entry, then ignore
+// the fact that '{' without a matching '}' is invalid.
+bool bStyleEntry = m_aStates.top().nDestinationState == 
DESTINATION_STYLEENTRY;
+
+while (!Strm().IsEof()  (m_aStates.top().nInternalState == INTERNAL_HEX 
|| ((ch != '{' || bStyleEntry)  ch != '}'  ch != '\\')))
 {
 if (m_aStates.top().nInternalState == INTERNAL_HEX || (ch != 0x0d  
ch != 0x0a))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source

2014-05-26 Thread Miklos Vajna
 sw/qa/extras/ww8import/data/bnc863018.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx  |   11 +++
 sw/source/filter/ww8/ww8par.cxx   |8 ++--
 sw/source/filter/ww8/ww8par.hxx   |4 ++--
 sw/source/filter/ww8/ww8par2.cxx  |   12 
 sw/source/filter/ww8/ww8par6.cxx  |   20 +++-
 6 files changed, 46 insertions(+), 9 deletions(-)

New commits:
commit 2569d24a099bb6b7208a9ad56f8debad911ab99b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon May 26 12:04:39 2014 +0200

bnc#863018 WW8 import: fix upper margin of multi-page floating table

A vert orient position was already handled in case a floating table was
imported as a TextFrame, but in case we didn't do that, the vert orient
position was simply lost.

Fix this by importing it as the upper margin of the table (assuming that
the position is relative from the anchor position).

Change-Id: I3e96f3068605fd6313dfb3e55483e1bce6c063a5
(cherry picked from commit 3755c87d0426a499d4755e82d8fbc77caa240764)

diff --git a/sw/qa/extras/ww8import/data/bnc863018.doc 
b/sw/qa/extras/ww8import/data/bnc863018.doc
new file mode 100755
index 000..ab7511b
Binary files /dev/null and b/sw/qa/extras/ww8import/data/bnc863018.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 5ec8f9f..8ef83c1 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -396,6 +396,17 @@ DECLARE_WW8IMPORT_TEST(testMsoBrightnessContrast, 
msobrightnesscontrast.doc)
 CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b4]));
 }
 
+DECLARE_WW8IMPORT_TEST(testBnc863018, bnc863018.doc)
+{
+// The problem was that there should be some whitespace above the table,
+// but there wasn't.
+uno::Referencetext::XTextTablesSupplier xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xIndexAccess(xTextTablesSupplier-getTextTables(), uno::UNO_QUERY);
+uno::Referencebeans::XPropertySet xTable(xIndexAccess-getByIndex(0), 
uno::UNO_QUERY);
+// This was 0.
+CPPUNIT_ASSERT_EQUAL(sal_Int32(5002), getPropertysal_Int32(xTable, 
TopMargin));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 41bfc4f..4712493 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2720,9 +2720,13 @@ bool SwWW8ImplReader::ProcessSpecial(bool rbReSync, 
WW8_CP nStartCp)
 maApos[nInTable] = false;
 }
 
+// So that SwWW8ImplReader::StartApo() can write into this, and
+// WW8TabDesc::CreateSwTable() can read it, if necessary.
+SvxULSpaceItem aULSpaceItem(RES_UL_SPACE);
+
 if (aApo.mbStartApo)
 {
-maApos[nInTable] = StartApo(aApo, pTabPos);
+maApos[nInTable] = StartApo(aApo, pTabPos, aULSpaceItem);
 // We need an ReSync after StartApo
 // (actually only if the Apo extends past a FKP border)
 rbReSync = true;
@@ -2738,7 +2742,7 @@ bool SwWW8ImplReader::ProcessSpecial(bool rbReSync, 
WW8_CP nStartCp)
 
 if(nInTable  nCellLevel)
 {
-if (StartTable(nStartCp))
+if (StartTable(nStartCp, aULSpaceItem))
 ++nInTable;
 else
 break;
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 0216817..99b5de2 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1466,7 +1466,7 @@ private:
 
 WW8FlyPara *ConstructApo(const ApoTestResults rApo,
 const WW8_TablePos *pTabPos);
-bool StartApo(const ApoTestResults rApo, const WW8_TablePos *pTabPos);
+bool StartApo(const ApoTestResults rApo, const WW8_TablePos *pTabPos, 
SvxULSpaceItem* pULSpaceItem = 0);
 void StopApo();
 bool TestSameApo(const ApoTestResults rApo, const WW8_TablePos *pTabPos);
 ApoTestResults TestApo(int nCellLevel, bool bTableRowEnd,
@@ -1516,7 +1516,7 @@ private:
 
 void ReadDocVars();
 
-bool StartTable(WW8_CP nStartCp);
+bool StartTable(WW8_CP nStartCp, SvxULSpaceItem* pULSpaceItem = 0);
 bool InEqualApo(int nLvl) const;
 bool InLocalApo() const { return InEqualApo(nInTable); }
 bool InEqualOrHigherApo(int nLvl) const;
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index c4ba4a9..324b85c 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -33,6 +33,7 @@
 #include editeng/brushitem.hxx
 #include editeng/boxitem.hxx
 #include editeng/lrspitem.hxx
+#include editeng/ulspitem.hxx
 #include editeng/fhgtitem.hxx
 #include editeng/hyphenzoneitem.hxx
 #include editeng/frmdiritem.hxx
@@ -178,7 +179,7 @@ public:
 
 WW8TabDesc( SwWW8ImplReader* pIoClass, WW8_CP nStartCp );
 bool Ok() const { return bOk; 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-05-26 Thread Miklos Vajna
 sw/qa/core/data/rtf/pass/fdo78900.rtf  |   11 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   11 +++
 2 files changed, 22 insertions(+)

New commits:
commit c9196ba88cc6262b88cbf8bd1e7af9ae78a3cc5b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon May 26 15:28:31 2014 +0200

fdo#78900 RTF import: allow \dpxsize inside \dptxbxtext

Previously we assumed that they always appear under \do directly.

Change-Id: Ie3a978da856986f604a3815d6127abb4191323c0
(cherry picked from commit 21c11ffe254612ac46aa891addacb0024d5b93f0)

diff --git a/sw/qa/core/data/rtf/pass/fdo78900.rtf 
b/sw/qa/core/data/rtf/pass/fdo78900.rtf
new file mode 100644
index 000..d379735
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/fdo78900.rtf
@@ -0,0 +1,11 @@
+{\rtf1\ansi\ansicpg1252\deff0\deftab720
+\viewkind1\paperw11910\paperh16845\margl225\margr225\margt225\margb225\headery0\footery0
+{
+{\*\do\dobxpage\dobypage\dptxbx
+{\dptxbxtext\dpx227\dpy227\dpxsize11911\dpysize9709\dplinehollow
+{hello
+}
+}
+}
+\par}
+}
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 6b31a1c..d66b668 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -5580,6 +5580,17 @@ int RTFDocumentImpl::popState()
 m_aStates.top().pCurrentBuffer-push_back(
 Buf_t(BUFFER_ENDSHAPE));
 }
+
+// It's allowed to declare these inside the the shape text, and they
+// are expected to have an effect for the whole shape.
+if (aState.aDrawingObject.nLeft)
+m_aStates.top().aDrawingObject.nLeft = aState.aDrawingObject.nLeft;
+if (aState.aDrawingObject.nTop)
+m_aStates.top().aDrawingObject.nTop = aState.aDrawingObject.nTop;
+if (aState.aDrawingObject.nRight)
+m_aStates.top().aDrawingObject.nRight = 
aState.aDrawingObject.nRight;
+if (aState.aDrawingObject.nBottom)
+m_aStates.top().aDrawingObject.nBottom = 
aState.aDrawingObject.nBottom;
 break;
 default:
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

2014-05-23 Thread Luboš Luňák
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx  |3 --
 sw/qa/extras/ooxmlimport/data/bnc875718.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   23 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   14 +
 4 files changed, 34 insertions(+), 6 deletions(-)

New commits:
commit cddc82bf9be203874f0564cc90c7e9f74ab0678d
Author: Luboš Luňák l.lu...@collabora.com
Date:   Sat May 24 00:36:06 2014 +0200

discard more header/footer stuff when discarding headers/footers 
(bnc#875718)

782adba4d436c65cdf85d48f28486321873b15ed discards unneeded headers/footers,
but only the text, not e.g. frames or fields. The test document therefore
ends up with a frame with a page number inside the body text, because the 
text
in the footer it should be anchored to was discarded. This commit fixes
this by discarding more (although probably the whole header/footer
shouldn't even be parsed to begin with).

The test from b349d2483e1fe64316d87b55d0b3b4c8f2293e2e actually checked
for this incorrect frame, so change that (the whole test is suspicious, as
the end result is quite far away from what the original doc looks like).

Change-Id: I2e7192e00237db1f030d0524c5667fe92c9e496b

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 7a69e67..608f11f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3453,8 +3453,7 @@ DECLARE_OOXMLEXPORT_TEST(testWordArtWithinDraingtool, 
testWordArtWithinDraingto
return;
 
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
 
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
-
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1],1);
-
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[4]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
+
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
 }
 
 #endif
diff --git a/sw/qa/extras/ooxmlimport/data/bnc875718.docx 
b/sw/qa/extras/ooxmlimport/data/bnc875718.docx
new file mode 100644
index 000..878a46f
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/bnc875718.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 3e2f2ac..0089c4a 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2126,6 +2126,29 @@ DECLARE_OOXMLIMPORT_TEST(testInlineGroupshape, 
inline-groupshape.docx)
 CPPUNIT_ASSERT_EQUAL(true, getPropertybool(getShape(1), Opaque));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testBnc875718, bnc875718.docx)
+{
+// The frame in the footer must not accidentally end up in the document 
body.
+// The easiest way for this to test I've found is checking that
+// xray ThisComponent.TextFrames.GetByIndex( index 
).Anchor.Text.ImplementationName
+// is not SwXBodyText but rather SwXHeadFootText
+uno::Referencetext::XTextFramesSupplier xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xIndexAccess(xTextFramesSupplier-getTextFrames(), uno::UNO_QUERY);
+for( int i = 0;
+ i  xIndexAccess-getCount();
+ ++i )
+{
+uno::Referencetext::XTextFrame frame(xIndexAccess-getByIndex( i ), 
uno::UNO_QUERY);
+uno::Referencetext::XTextRange range(frame-getAnchor(), 
uno::UNO_QUERY);
+uno::Referencelang::XServiceInfo text(range-getText(), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL( OUString( SwXHeadFootText ), 
text-getImplementationName());
+}
+// Also check that the footer contents are not in the body text.
+uno::Referencetext::XTextDocument textDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencetext::XText text(textDocument-getText(), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL( OUString( Text\n ), text-getString());
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 4a5b8a4..816e85d 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2435,6 +2435,8 @@