[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 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 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 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 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/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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 @@