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

2015-10-07 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/tdf92454.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |   10 ++
 writerfilter/source/dmapper/DomainMapper.cxx |7 +++
 3 files changed, 17 insertions(+)

New commits:
commit 2ca166ebbe2adbd8f129403c7f8e5646c70ab67d
Author: Miklos Vajna 
Date:   Tue Sep 22 08:47:03 2015 +0200

tdf#92454 DOCX import: allow overriding para prop from num style in para 
style

Word has a feature like this: a paragraph style can refer to a numbering
style, and both can specify paragraph margins. If that's the case, then
the ones from the paragraph style has priority.

In Writer, the numbering style has priority, so the only chance for
correct import result is to set the margin directly on the paragraph in
this case.

(cherry picked from commit f4badd9a485f32f787d78431ed673e2932973887)

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

Change-Id: Iff3b03bcc56e0db3a48452c293acf41c91b8f159
Reviewed-on: https://gerrit.libreoffice.org/19100
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sw/qa/extras/ooxmlimport/data/tdf92454.docx 
b/sw/qa/extras/ooxmlimport/data/tdf92454.docx
new file mode 100644
index 000..7042668
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf92454.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index fa8d504..a71c4f9 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2647,6 +2647,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf93919, "tdf93919.docx")
 CPPUNIT_ASSERT_EQUAL(static_cast(1270), 
getProperty(getParagraph(1), "ParaLeftMargin"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf92454, "tdf92454.docx")
+{
+// The first paragraph had a large indentation / left margin as inheritance
+// in Word and Writer works differently, and no direct value was set to be
+// explicit.
+uno::Reference xParagraph(getParagraph(1), 
uno::UNO_QUERY);
+// This was beans::PropertyState_DEFAULT_VALUE.
+CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, 
xParagraph->getPropertyState("ParaFirstLineIndent"));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index a56fbed..835e973 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2017,6 +2017,13 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, 
PropertyMapPtr rContext )
 
 rContext->Insert(PROP_PARA_RIGHT_MARGIN, 
uno::makeAny(nParaRightMargin));
 }
+
+// Indent properties from the paragraph style have priority
+// over the ones from the numbering styles in Word, not in
+// Writer.
+boost::optional oProperty;
+if (pStyleSheetProperties && (oProperty = 
pStyleSheetProperties->getProperty(PROP_PARA_FIRST_LINE_INDENT)))
+rContext->Insert(PROP_PARA_FIRST_LINE_INDENT, 
oProperty->second);
 }
 
 if( pStyleSheetProperties && pStyleSheetProperties->GetListLevel() 
>= 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-4' - sw/qa writerfilter/source

2015-10-01 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/tdf93919.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |6 ++
 writerfilter/source/dmapper/DomainMapper.cxx |5 +
 3 files changed, 11 insertions(+)

New commits:
commit 950cfbd75a216527d850351e4b3e0be4f8870a7d
Author: Miklos Vajna 
Date:   Mon Sep 28 14:03:25 2015 +0200

bnc#939996 tdf#93919 DOCX import: fix left-from-style and first-from-direct

With this,  as direct paragraph formatting and
 as a numbering level formatting is
properly merged, i.e. w:left is not lost, defaulting to 0.

(cherry picked from commit 56341e5d496f576dc45fe8e6c44831d780fecb73)

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

Change-Id: If5534fbd9ee6d41139b0ed3a3df9d0cc5aad3239
Reviewed-on: https://gerrit.libreoffice.org/18907
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/qa/extras/ooxmlimport/data/tdf93919.docx 
b/sw/qa/extras/ooxmlimport/data/tdf93919.docx
new file mode 100644
index 000..c745469
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf93919.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 20cb6fe..fa8d504 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2641,6 +2641,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf87924, "tdf87924.docx")
 CPPUNIT_ASSERT_EQUAL(static_cast(0), 
aGeometry["TextPreRotateAngle"].get());
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf93919, "tdf93919.docx")
+{
+// This was 0, left margin was not inherited from the list style.
+CPPUNIT_ASSERT_EQUAL(static_cast(1270), 
getProperty(getParagraph(1), "ParaLeftMargin"));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index b0c6724..a56fbed 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -466,6 +466,11 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
 sal_Int32 nValue = ConversionHelper::convertTwipToMM100( 
nIntValue );
 m_pImpl->GetTopContext()->Insert(
 PROP_PARA_FIRST_LINE_INDENT, uno::makeAny( - nValue ));
+
+// See above, need to inherit left margin from list style when 
first is set.
+sal_Int32 nParaLeftMargin = 
m_pImpl->getCurrentNumberingProperty("IndentAt");
+if (nParaLeftMargin != 0)
+m_pImpl->GetTopContext()->Insert(PROP_PARA_LEFT_MARGIN, 
uno::makeAny(nParaLeftMargin), /*bOverwrite=*/false);
 }
 break;
 case NS_ooxml::LN_CT_Ind_firstLine:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-10-01 Thread Miklos Vajna
 sw/qa/extras/ooxmlexport/data/tdf92521.odt   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx|7 
 sw/source/filter/ww8/attributeoutputbase.hxx |2 -
 sw/source/filter/ww8/docxattributeoutput.cxx |   31 +
 sw/source/filter/ww8/docxattributeoutput.hxx |2 -
 sw/source/filter/ww8/docxexport.cxx  |3 +
 sw/source/filter/ww8/rtfattributeoutput.cxx  |   47 ++-
 sw/source/filter/ww8/rtfattributeoutput.hxx  |2 -
 sw/source/filter/ww8/ww8attributeoutput.hxx  |2 -
 9 files changed, 62 insertions(+), 34 deletions(-)

New commits:
commit f624559bbfa2cfb8cc2a081174be2ac6b0ed9dcb
Author: Miklos Vajna 
Date:   Mon Sep 21 07:31:33 2015 +0200

tdf#92521 DOCX export: handle section break right after a table

DocxAttributeOutput::SectionBreaks() previously only handled the
text-text and text-table node transitions; implement support for
table-text to avoid loosing a page break on export for the bugdoc.

(View this commit with whitespace ignored to filter out the noise about
SectionBreaks() now accepting non-text nodes, too.)

(cherry picked from commit c916152d8562cab868d4c522748ac30029fad179)

Conflicts:
sw/source/filter/ww8/attributeoutputbase.hxx
sw/source/filter/ww8/docxattributeoutput.cxx
sw/source/filter/ww8/docxattributeoutput.hxx
sw/source/filter/ww8/rtfattributeoutput.cxx
sw/source/filter/ww8/rtfattributeoutput.hxx
sw/source/filter/ww8/ww8attributeoutput.hxx

Change-Id: Ie8a1575374a207399351635bda8c0c076ce7268d
Reviewed-on: https://gerrit.libreoffice.org/18901
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf92521.odt 
b/sw/qa/extras/ooxmlexport/data/tdf92521.odt
new file mode 100644
index 000..8148e49
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf92521.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 5690507..ea3c6af 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -810,6 +810,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf83227, "tdf83227.docx")
 CPPUNIT_ASSERT_EQUAL(false, 
bool(xNameAccess->hasByName("word/media/image2.png")));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf92521, "tdf92521.odt")
+{
+if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
+// There should be a section break that's in the middle of the 
document: right after the table.
+assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr", 1);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx 
b/sw/source/filter/ww8/attributeoutputbase.hxx
index 1dffa63..84a1d70 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -156,7 +156,7 @@ public:
 virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t 
pTextNodeInfoInner ) = 0;
 
 /// Called in order to output section breaks.
-virtual void SectionBreaks(const SwTxtNode& rNode) = 0;
+virtual void SectionBreaks(const SwNode& rNode) = 0;
 
 /// Called before we start outputting the attributes.
 virtual void StartParagraphProperties() = 0;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4cba427..ade163e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -750,7 +750,7 @@ void DocxAttributeOutput::EmptyParagraph()
 m_pSerializer->singleElementNS( XML_w, XML_p, FSEND );
 }
 
-void DocxAttributeOutput::SectionBreaks(const SwTxtNode& rNode)
+void DocxAttributeOutput::SectionBreaks(const SwNode& rNode)
 {
 // output page/section breaks
 // Writer can have them at the beginning of a paragraph, or at the end, but
@@ -758,16 +758,31 @@ void DocxAttributeOutput::SectionBreaks(const SwTxtNode& 
rNode)
 // paragraph in a section.  To get it right, we have to switch to the next
 // paragraph, and detect the section breaks there.
 SwNodeIndex aNextIndex( rNode, 1 );
-if ( aNextIndex.GetNode().IsTxtNode() )
+
+if (rNode.IsTxtNode())
 {
-const SwTxtNode* pTxtNode = static_cast< SwTxtNode* >( 
() );
-m_rExport.OutputSectionBreaks( pTxtNode->GetpSwAttrSet(), *pTxtNode, 
m_tableReference->m_bTableCellOpen, pTxtNode->GetTxt().isEmpty() );
+if (aNextIndex.GetNode().IsTxtNode())
+{
+const SwTxtNode* pTxtNode = 
static_cast(());
+m_rExport.OutputSectionBreaks(pTxtNode->GetpSwAttrSet(), 
*pTxtNode, m_tableReference->m_bTableCellOpen, pTxtNode->GetTxt().isEmpty());
+}
+else if (aNextIndex.GetNode().IsTableNode())
+{
+  

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

2015-09-23 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/hang-9.doc |binary
 sw/source/filter/ww8/ww8scan.cxx|   12 
 2 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit b477a8d5df518cd8c30a1a21e3ffccc8bac88084
Author: Caolán McNamara 
Date:   Mon Sep 21 12:14:19 2015 +0100

don't hang on busted subdocument offsets

Change-Id: I5d1d18f864496ec98894703f0a22e211a9dd14a5
(cherry picked from commit a2b90cd04733c2ec3b9cb3bb56d95f3298571ecc)
Reviewed-on: https://gerrit.libreoffice.org/18748
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/sw/qa/core/data/ww8/pass/hang-9.doc 
b/sw/qa/core/data/ww8/pass/hang-9.doc
new file mode 100644
index 000..4e9e412
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-9.doc differ
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index c8afe52..2c2a46b 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4431,11 +4431,15 @@ void WW8PLCFxDesc::ReduceByOffset()
 else
 nStartPos -= nCpOfs;
 }
-if( nEndPos != WW8_CP_MAX )
+if (nEndPos != WW8_CP_MAX)
 {
-OSL_ENSURE(nCpOfs <= nEndPos,
-"oh oh, so much for the subdocument piece theory");
-nEndPos   -= nCpOfs;
+if (nCpOfs > nEndPos)
+{
+SAL_WARN("sw.ww8", "broken subdocument piece entry");
+nEndPos = WW8_CP_MAX;
+}
+else
+nEndPos -= nCpOfs;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-15 Thread Vasily Melenchuk
 sw/qa/extras/htmlexport/data/tdf90905.odt |binary
 sw/qa/extras/htmlexport/htmlexport.cxx|3 ++-
 sw/source/filter/html/wrthtml.cxx |3 ++-
 3 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 0bd99a77e1655cee63ad7ec2bb25e45d13aac44d
Author: Vasily Melenchuk 
Date:   Tue Aug 25 17:45:11 2015 +0300

tdf#93449 Internal hyperlinks are not exported corectly in HTML

InetURLObject class does not work correctly with internal document
links, containing not full url, but just a fragment. This case added
as an exception for HTML link export.

Change-Id: I44496a1cf186836d4194fc65ce7bf9aeb2f79b65
Reviewed-on: https://gerrit.libreoffice.org/17993
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 
(cherry picked from commit fd3468024e1ac199f4a2f4108321ef8100d58414)
Signed-off-by: Michael Stahl 

diff --git a/sw/qa/extras/htmlexport/data/tdf90905.odt 
b/sw/qa/extras/htmlexport/data/tdf90905.odt
index cab8a04..19a51bd 100644
Binary files a/sw/qa/extras/htmlexport/data/tdf90905.odt and 
b/sw/qa/extras/htmlexport/data/tdf90905.odt differ
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 54f7bf1..ca6ad26 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -249,7 +249,8 @@ DECLARE_HTMLEXPORT_TEST(testExportInternalUrl, 
"tdf90905.odt")
 CPPUNIT_ASSERT(pDoc);
 
 // Internal url should be valid
-assertXPath(pDoc, "/html/body/p/a", "href", "#0.0.1.Text|outline");
+assertXPath(pDoc, "/html/body/p[1]/a", "href", "#0.0.1.Text|outline");
+assertXPath(pDoc, "/html/body/p[2]/a", "href", "#bookmark");
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/html/wrthtml.cxx 
b/sw/source/filter/html/wrthtml.cxx
index 5de95b2..04d0604 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1198,8 +1198,9 @@ OUString SwHTMLWriter::convertHyperlinkHRefValue(const 
OUString& rURL)
 }
 }
 }
-else
+else if (!sURL.isEmpty() && sURL[0] != '#')
 {
+// Link is not started from "#", so looks like external link. Encode 
this URL.
 INetURLObject aURL(sURL);
 sURL = aURL.GetMainURL(INetURLObject::NO_DECODE);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-03 Thread Caolán McNamara
 sw/qa/extras/ooxmlexport/data/tdf93676-1.odt |binary
 sw/source/filter/ww8/docxsdrexport.cxx   |   10 ++
 sw/source/filter/ww8/rtfattributeoutput.cxx  |   10 ++
 3 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 327fb3ec1df35f2e92e3e18083f746a18201ec71
Author: Caolán McNamara 
Date:   Thu Sep 3 11:33:36 2015 +0100

Related: tdf#93676 special 255 Percent Flag should not be exported to docx

as a true percentage value. 255 is a special flag that the value is synced 
to
the other dimension. Without this word gives the frame in the attached 
example
a huge height.

(cherry picked from commit b2ad33fd5a1ee0cd9a1e657725aedc90da659f24)

Change-Id: Ida0c15779d4583ca075428d77b8dc03c32f22edb
Reviewed-on: https://gerrit.libreoffice.org/18303
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf93676-1.odt 
b/sw/qa/extras/ooxmlexport/data/tdf93676-1.odt
new file mode 100644
index 000..37d621b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf93676-1.odt differ
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index a7dc475..7c21a11 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1525,23 +1525,25 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* 
pParentFrame, int nAnchorId, bo
 pFS->endElementNS(XML_a, XML_graphic);
 
 // Relative size of the Text Frame.
-if (rSize.GetWidthPercent())
+const sal_uInt8 nWidthPercent = rSize.GetWidthPercent();
+if (nWidthPercent && nWidthPercent != 0xff)
 {
 pFS->startElementNS(XML_wp14, XML_sizeRelH,
 XML_relativeFrom, 
(rSize.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME ? "page" : 
"margin"),
 FSEND);
 pFS->startElementNS(XML_wp14, XML_pctWidth, FSEND);
-pFS->writeEscaped(OUString::number(rSize.GetWidthPercent() * 
oox::drawingml::PER_PERCENT));
+pFS->writeEscaped(OUString::number(nWidthPercent * 
oox::drawingml::PER_PERCENT));
 pFS->endElementNS(XML_wp14, XML_pctWidth);
 pFS->endElementNS(XML_wp14, XML_sizeRelH);
 }
-if (rSize.GetHeightPercent())
+const sal_uInt8 nHeightPercent = rSize.GetHeightPercent();
+if (nHeightPercent && nHeightPercent != 0xff)
 {
 pFS->startElementNS(XML_wp14, XML_sizeRelV,
 XML_relativeFrom, 
(rSize.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME ? "page" 
: "margin"),
 FSEND);
 pFS->startElementNS(XML_wp14, XML_pctHeight, FSEND);
-pFS->writeEscaped(OUString::number(rSize.GetHeightPercent() * 
oox::drawingml::PER_PERCENT));
+pFS->writeEscaped(OUString::number(nHeightPercent * 
oox::drawingml::PER_PERCENT));
 pFS->endElementNS(XML_wp14, XML_pctHeight);
 pFS->endElementNS(XML_wp14, XML_sizeRelV);
 }
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index da8f01f..d9550c0 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1610,9 +1610,10 @@ void lcl_TextFrameRelativeSize(std::vector< 
std::pair >& rFlyP
 const SwFmtFrmSize& rSize = rFrmFmt.GetFrmSize();
 
 // Relative size of the Text Frame.
-if (rSize.GetWidthPercent())
+const sal_uInt8 nWidthPercent = rSize.GetWidthPercent();
+if (nWidthPercent && nWidthPercent != 0xff)
 {
-rFlyProperties.push_back(std::make_pair("pctHoriz", 
OString::number(rSize.GetWidthPercent() * 10)));
+rFlyProperties.push_back(std::make_pair("pctHoriz", 
OString::number(nWidthPercent * 10)));
 
 OString aRelation;
 switch (rSize.GetWidthPercentRelation())
@@ -1626,9 +1627,10 @@ void lcl_TextFrameRelativeSize(std::vector< 
std::pair >& rFlyP
 }
 rFlyProperties.push_back(std::make_pair("sizerelh", aRelation));
 }
-if (rSize.GetHeightPercent())
+const sal_uInt8 nHeightPercent = rSize.GetHeightPercent();
+if (nHeightPercent && nHeightPercent != 0xff)
 {
-rFlyProperties.push_back(std::make_pair("pctVert", 
OString::number(rSize.GetHeightPercent() * 10)));
+rFlyProperties.push_back(std::make_pair("pctVert", 
OString::number(nHeightPercent * 10)));
 
 OString aRelation;
 switch (rSize.GetHeightPercentRelation())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

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

2015-09-03 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/hang-8.doc |binary
 sw/source/filter/ww8/ww8scan.cxx|   13 +
 2 files changed, 13 insertions(+)

New commits:
commit 648cae8562179d66b3075a43d4b29a76018a28a0
Author: Caolán McNamara 
Date:   Wed Sep 2 20:44:06 2015 +0100

doc para property ranges cannot be 0 length

Change-Id: If946204873343d8bbc0c1d391ca2c65d8b2f8561
(cherry picked from commit ed7d22049596ac91ad75bfad1a5675c13714e203)
Reviewed-on: https://gerrit.libreoffice.org/18300
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/sw/qa/core/data/ww8/pass/hang-8.doc 
b/sw/qa/core/data/ww8/pass/hang-8.doc
new file mode 100644
index 000..4f0e30e
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-8.doc differ
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 0cd7b68..c8afe52 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4364,6 +4364,19 @@ bool WW8PLCFx_AtnBook::getIsEnd() const
 // dadurch kein AErger zu erwarten ist.
 void WW8PLCFMan::AdjustEnds( WW8PLCFxDesc& rDesc )
 {
+// might be necessary to do this for pChp and/or pSep as well,
+// but its definitely the case for paragraphs that EndPos > StartPos
+// for a well formed paragraph as those always have a paragraph
+//  in them
+if ( == pPap && rDesc.bRealLineEnd)
+{
+if (rDesc.nStartPos == rDesc.nEndPos && rDesc.nEndPos != WW8_CP_MAX)
+{
+SAL_WARN("sw.ww8", "WW8PLCFxDesc End same as Start, abandoning to 
avoid looping");
+rDesc.nEndPos = WW8_CP_MAX;
+}
+}
+
 //Store old end position for supercool new property finder that uses
 //cp instead of fc's as nature intended
 rDesc.nOrigEndPos = rDesc.nEndPos;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-09-02 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/hang-7.doc |binary
 sw/source/filter/ww8/ww8toolbar.cxx |   44 +---
 2 files changed, 26 insertions(+), 18 deletions(-)

New commits:
commit 13a0e48dd49ec811e41aaa03c3009b9a4f92bf30
Author: Caolán McNamara 
Date:   Mon Aug 31 15:11:03 2015 +0100

check for over long record len and check reads

Change-Id: Ib77ce1b95db2dc4396f4fd2fdcff4c0344b20c9e
(cherry picked from commit 0c191e2b757555b147ebab1688e72acde28062a1)
Reviewed-on: https://gerrit.libreoffice.org/18180
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/sw/qa/core/data/ww8/pass/hang-7.doc 
b/sw/qa/core/data/ww8/pass/hang-7.doc
new file mode 100644
index 000..a52a452f
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-7.doc differ
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx 
b/sw/source/filter/ww8/ww8toolbar.cxx
index e33a8c5..1232d44 100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@ -167,7 +167,7 @@ bool SwCTBWrapper::Read( SvStream& rS )
 {
 rCustomizations[ *it ].bIsDroppedMenuTB = true;
 }
-return true;
+return rS.good();
 }
 
 SwTBC* SwCTBWrapper::GetTBCAtOffset( sal_uInt32 nStreamOffset )
@@ -285,7 +285,7 @@ bool Customization::Read( SvStream )
 if ( !customizationDataCTB->Read( rS ) )
 return false;
 }
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -455,7 +455,7 @@ bool TBDelta::Read(SvStream )
 nOffSet = rS.Tell();
 rS.ReadUChar( doprfatendFlags ).ReadUChar( ibts ).ReadInt32( cidNext 
).ReadInt32( cid ).ReadInt32( fc ) ;
 rS.ReadUInt16( CiTBDE ).ReadUInt16( cbTBC );
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -525,7 +525,7 @@ bool SwCTB::Read( SvStream )
 rTBC.push_back( aTBC );
 }
 }
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -638,7 +638,7 @@ bool SwTBC::Read( SvStream  )
 if ( !tbcd->Read( rS ) )
 return false;
 }
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -778,7 +778,7 @@ Xst::Read( SvStream& rS )
 SAL_INFO("sw.ww8","Xst::Read() stream pos 0x" << std::hex << rS.Tell() );
 nOffSet = rS.Tell();
 sString = read_uInt16_PascalString(rS);
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -914,7 +914,7 @@ bool Tcg255::Read(SvStream )
 nId = 0x40;
 rS.ReadUChar( nId );
 }
-return true;
+return rS.good();
 // Peek at
 }
 
@@ -946,7 +946,7 @@ bool Tcg255SubStruct::Read(SvStream )
 nOffSet = rS.Tell();
 if ( mbReadId )
 rS.ReadUChar( ch );
-return true;
+return rS.good();
 }
 
 PlfMcd::PlfMcd(bool bReadId)
@@ -970,7 +970,7 @@ bool PlfMcd::Read(SvStream )
 return false;
 }
 }
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -1005,7 +1005,15 @@ bool PlfAcd::Read( SvStream )
 nOffSet = rS.Tell();
 Tcg255SubStruct::Read( rS );
 rS.ReadInt32( iMac );
-if ( iMac )
+if (iMac < 0)
+return false;
+auto nMaxPossibleRecords = rS.remainingSize() / (sizeof(sal_uInt16)*2);
+if (static_cast(iMac) > nMaxPossibleRecords)
+{
+SAL_WARN("sw.ww8", iMac << " records claimed, but max possible is " << 
nMaxPossibleRecords);
+iMac = nMaxPossibleRecords;
+}
+if (iMac)
 {
 rgacd = new Acd[ iMac ];
 for ( sal_Int32 index = 0; index < iMac; ++index )
@@ -1014,7 +1022,7 @@ bool PlfAcd::Read( SvStream )
 return false;
 }
 }
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -1058,7 +1066,7 @@ bool PlfKme::Read(SvStream )
 return false;
 }
 }
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -1126,7 +1134,7 @@ bool TcgSttbfCore::Read( SvStream& rS )
 rS.ReadUInt16( dataItems[ index ].extraData );
 }
 }
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -1176,7 +1184,7 @@ bool MacroNames::Read( SvStream )
 return false;
 }
 }
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -1230,7 +1238,7 @@ Xstz::Read(SvStream )
 rS.ReadUInt16( chTerm );
 if ( chTerm != 0 ) // should be an assert
 return false;
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -1263,7 +1271,7 @@ Kme::Read(SvStream )
 SAL_INFO("sw.ww8","Kme::Read() stream pos 0x" << std::hex << rS.Tell() );
 nOffSet = rS.Tell();
 rS.ReadInt16( reserved1 ).ReadInt16( reserved2 ).ReadUInt16( kcm1 
).ReadUInt16( kcm2 ).ReadUInt16( kt ).ReadUInt32( param );
-return true;
+return rS.good();
 }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -1291,7 +1299,7 @@ bool Acd::Read(SvStream )
 

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

2015-09-02 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/hang-6.doc |binary
 sw/source/filter/ww8/ww8par.cxx |   22 +-
 2 files changed, 13 insertions(+), 9 deletions(-)

New commits:
commit 2284ada74ac0dd66b4f5e3e811a85fc6c458d13a
Author: Caolán McNamara 
Date:   Mon Aug 31 13:21:19 2015 +0100

check for ridiculous lengths and check stream status

Change-Id: Iefe943794e005f03b2a6ea5fc642b8c3d21b3334
(cherry picked from commit 858257d465b7e7ce54819cc2f631efcb20632863)
Reviewed-on: https://gerrit.libreoffice.org/18174
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/sw/qa/core/data/ww8/pass/hang-6.doc 
b/sw/qa/core/data/ww8/pass/hang-6.doc
new file mode 100644
index 000..48293c5
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-6.doc differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 2b0170b..ad69a1f 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -677,16 +677,22 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
  SEEK_FROM_CURRENT_AND_RESTART )
 && maShapeRecords.Current()->nRecLen )
 {
-sal_uInt32  nBytesLeft = maShapeRecords.Current()->nRecLen;
-sal_uInt32  nUDData;
-sal_uInt16  nPID;
+sal_uInt32 nBytesLeft = maShapeRecords.Current()->nRecLen;
+auto nAvailableBytes = rSt.remainingSize();
+if (nBytesLeft > nAvailableBytes)
+{
+SAL_WARN("sw.ww8", "Document claimed to have shape record of " 
<< nBytesLeft << " bytes, but only " << nAvailableBytes << " available");
+nBytesLeft = nAvailableBytes;
+}
 while( 5 < nBytesLeft )
 {
-rSt.ReadUInt16( nPID );
-if ( rSt.GetError() != 0 )
+sal_uInt16 nPID(0);
+rSt.ReadUInt16(nPID);
+sal_uInt32 nUDData(0);
+rSt.ReadUInt32(nUDData);
+if (!rSt.good())
 break;
-rSt.ReadUInt32( nUDData );
-switch( nPID )
+switch (nPID)
 {
 case 0x038F: pImpRec->nXAlign = nUDData; break;
 case 0x0390:
@@ -714,8 +720,6 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
 pImpRec->isHorizontalRule = true;
 break;
 }
-if ( rSt.GetError() != 0 )
-break;
 nBytesLeft  -= 6;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-29 Thread Michael Stahl
 sw/qa/extras/odfexport/data/tdf92379.fodt |   26 ++
 sw/qa/extras/odfexport/odfexport.cxx  |   43 +-
 sw/source/core/unocore/unostyle.cxx   |6 +++-
 3 files changed, 73 insertions(+), 2 deletions(-)

New commits:
commit f27cba26afe416de48b7ff2cded69ae60ae14fd4
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 25 19:08:00 2015 +0200

tdf#92379: sw: ODF import: fix fo:background-color=transparent

The problem is that if the FillStyle is NONE, setting only
ParaBackTransparent but not ParaBackColor does absolutely nothing.

This means that if a parent style sets a background color, then a
derived style cannot override it to be transparent.

Cause is that getSvxBrushItemFromSourceSet() defaults to setting a
0xFF transparency on the SvxBrushItem.

There is still a problem that getSvxBrushItemFromSourceSet() sets the
pool default item's color and that is also exported to ODF again as
draw:fill-color, but together with draw:fill=none it should not cause
harm, at least for consumers that prefer draw:fill attributes like
LO = 4.4.

(regression from 7d9bb549d498d6beed2c4050c402d09643febdfa)

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

diff --git a/sw/qa/extras/odfexport/data/tdf92379.fodt 
b/sw/qa/extras/odfexport/data/tdf92379.fodt
index 280dc5a..8aeb9c4 100644
--- a/sw/qa/extras/odfexport/data/tdf92379.fodt
+++ b/sw/qa/extras/odfexport/data/tdf92379.fodt
@@ -37,6 +37,32 @@
   /style:graphic-properties
 /style:style
 
+!-- Titre Avis expert and derived styles from bugdoc --
+style:style style:name=Titre_20_Avis_20_expert 
style:display-name=Titre Avis expert style:family=paragraph 
style:parent-style-name=Standard style:master-page-name=
+  style:paragraph-properties fo:text-align=start 
style:justify-single-word=false style:page-number=auto 
fo:background-color=#661900
+style:background-image/
+  /style:paragraph-properties
+  style:text-properties fo:color=#ff /
+/style:style
+style:style style:name=Avis_20_expert_20_questions 
style:display-name=Avis expert questions style:family=paragraph 
style:parent-style-name=Titre_20_Avis_20_expert style:master-page-name=
+  style:paragraph-properties fo:line-height=100% fo:text-align=start 
style:justify-single-word=false style:page-number=auto 
fo:background-color=transparent
+style:background-image/
+  /style:paragraph-properties
+  style:text-properties fo:color=#661900 /
+/style:style
+style:style style:name=avis_20_expert_20_questions_20_non_20_cadres 
style:display-name=avis expert questions non cadres style:family=paragraph 
style:parent-style-name=Avis_20_expert_20_questions style:master-page-name=
+  style:paragraph-properties style:page-number=auto 
fo:background-color=#801900 style:shadow=none
+style:tab-stops/
+style:background-image/
+  /style:paragraph-properties
+/style:style
+style:style style:name=Avis_20_expert_20_rXponses 
style:display-name=Avis expert rXponses style:family=paragraph 
style:parent-style-name=Avis_20_expert_20_questions style:master-page-name=
+  style:paragraph-properties fo:line-height=100% 
fo:text-align=justify style:justify-single-word=false fo:orphans=0 
fo:widows=0 fo:hyphenation-ladder-count=1 style:page-number=auto 
fo:background-color=transparent
+style:background-image/
+  /style:paragraph-properties
+  style:text-properties fo:color=#461900 fo:hyphenate=true 
fo:hyphenation-remain-char-count=2 fo:hyphenation-push-char-count=2/
+/style:style
+
  /office:styles
  office:automatic-styles
   style:page-layout style:name=pm1
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index c1dc7ab..308a83d 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -82,7 +82,48 @@ DECLARE_ODFEXPORT_TEST(testTdf92379, tdf92379.fodt)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getPropertysal_Int32(xStyle, 
BackColorTransparency));
 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, 
getPropertydrawing::FillStyle(xStyle, FillStyle));
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffcc99), getPropertysal_Int32(xStyle, 
FillColor));
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getPropertysal_Int32(xStyle, 
FillTransparence));
+CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getPropertysal_Int16(xStyle, 
FillTransparence));
+
+// paragraph style fo:background-color was wrongly inherited despite being
+// overridden in derived style
+uno::Referencecontainer::XNameAccess 
xParaStyles(getStyles(ParagraphStyles));
+uno::Referencebeans::XPropertySet xStyle1(xParaStyles-getByName(

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

2015-08-29 Thread Michael Stahl
 sw/qa/extras/odfexport/odfexport.cxx   |9 +
 sw/source/core/unocore/swunohelper.cxx |   14 +-
 2 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit b77b0c467ae55e3368b33d9dc248d86853e4510c
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 25 23:29:18 2015 +0200

related: tdf#92379: sw: backward compatible ODF export of overriding

... frame/paragraph backgrounds.

If a style is set to have draw:fill=solid and a derived style to
draw:fill=none then the derived one must have
fo:background-color=transparent to override the parent for old
consumers like LO = 4.3/AOO = 4.1 that don't understand draw:fill.

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

diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index 308a83d..d3ee3ee 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -124,6 +124,15 @@ DECLARE_ODFEXPORT_TEST(testTdf92379, tdf92379.fodt)
 //CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff), 
getPropertysal_Int32(xStyle32, FillColor));
 //CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getPropertysal_Int16(xStyle32, 
FillTransparence));
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0x461900), getPropertysal_Int32(xStyle32, 
CharColor));
+
+if (xmlDocPtr pXmlDoc = parseExport(styles.xml))
+{
+// check that fo:background-color attribute is exported properly
+assertXPath(pXmlDoc, //style:style[@style:family='paragraph' and 
@style:display-name='Titre Avis 
expert']/style:paragraph-properties[@fo:background-color='#661900'], 1);
+assertXPath(pXmlDoc, //style:style[@style:family='paragraph' and 
@style:display-name='Avis expert 
questions']/style:paragraph-properties[@fo:background-color='transparent'], 1);
+assertXPath(pXmlDoc, //style:style[@style:family='paragraph' and 
@style:display-name='avis expert questions non 
cadres']/style:paragraph-properties[@fo:background-color='#801900'], 1);
+assertXPath(pXmlDoc, //style:style[@style:family='paragraph' and 
@style:display-name='Avis expert 
rXponses']/style:paragraph-properties[@fo:background-color='transparent'], 1);
+}
 }
 
 DECLARE_ODFEXPORT_TEST(testFdo79358, fdo79358.odt)
diff --git a/sw/source/core/unocore/swunohelper.cxx 
b/sw/source/core/unocore/swunohelper.cxx
index c6f6729..a20caab 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -286,7 +286,18 @@ bool needToMapFillItemsToSvxBrushItemTypes(const 
SfxItemSet rSet,
 switch (eFill)
 {
 case drawing::FillStyle_NONE:
-return false; // ignoring some extremely limited XFillColorItem 
eval
+// claim that BackColor and BackTransparent are available so that
+// fo:background=transparent attribute is exported to override
+// the parent style in case it is != NONE
+switch (nMID)
+{
+case MID_BACK_COLOR:
+case MID_BACK_COLOR_R_G_B:
+case MID_GRAPHIC_TRANSPARENT: // this is *BackTransparent
+return true;
+default:
+return false;
+}
 break;
 case drawing::FillStyle_SOLID:
 case drawing::FillStyle_GRADIENT: // gradient and hatch don't exist in
@@ -294,6 +305,7 @@ bool needToMapFillItemsToSvxBrushItemTypes(const 
SfxItemSet rSet,
 switch (nMID)
 {
 case MID_BACK_COLOR:
+case MID_GRAPHIC_TRANSPARENT: // this is *BackTransparent
 // Gradient/Hatch always have emulated color
 return (drawing::FillStyle_SOLID != eFill)
 || SfxItemState::SET == 
rSet.GetItemState(XATTR_FILLCOLOR)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-26 Thread Caolán McNamara
 sw/qa/core/data/ww5/pass/crash-2.doc |binary
 sw/source/filter/ww8/ww8par4.cxx |9 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit f6790861e289a9c7c1d6b49757a8e405b2f65b17
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Aug 25 08:55:09 2015 +0100

there may be no storage available in older formats

(cherry picked from commit 666fb214e93d542dd80e48b9e008727129b5764f)

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

diff --git a/sw/qa/core/data/ww5/pass/crash-2.doc 
b/sw/qa/core/data/ww5/pass/crash-2.doc
new file mode 100644
index 000..23a1897
Binary files /dev/null and b/sw/qa/core/data/ww5/pass/crash-2.doc differ
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index b09fec6..c215283 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -337,8 +337,11 @@ bool SwWW8ImplReader::ImportOleWMF(SvStorageRef 
xSrc1,GDIMetaFile rWMF,
 SdrObject* SwWW8ImplReader::ImportOleBase( Graphic rGraph,
 const Graphic* pGrf, const SfxItemSet* pFlySet, const Rectangle aVisArea )
 {
-SdrObject* pRet = 0;
-OSL_ENSURE( pStg, ohne storage geht hier fast gar nichts! );
+if (!pStg)
+{
+SAL_WARN(sw.ww8, no storage for ole objects);
+return nullptr;
+}
 
 ::SetProgressState( nProgress, rDoc.GetDocShell() ); // Update
 
@@ -390,6 +393,8 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic rGraph,
 }
 }
 
+SdrObject* pRet = 0;
+
 if (!(bIsHeader || bIsFooter))
 {
 //Can't put them in headers/footers :-(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-26 Thread Caolán McNamara
 sw/qa/core/data/ww5/pass/crash-3.doc |binary
 sw/source/filter/ww8/ww8graf.cxx |   69 +--
 sw/source/filter/ww8/ww8par.hxx  |1 
 3 files changed, 59 insertions(+), 11 deletions(-)

New commits:
commit 0c689034cf65d5b65d32e00e2f0b0567c51df866
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Aug 25 10:48:12 2015 +0100

ensure editeng str len is in sync with attributes

for the duration of inserting attributes, and excess
dos newline chars can be removed safely afterwards

(cherry picked from commit cc596d8d0f2f896d000833ffcba0035e3812c657)

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

diff --git a/sw/qa/core/data/ww5/pass/crash-3.doc 
b/sw/qa/core/data/ww5/pass/crash-3.doc
new file mode 100644
index 000..54931a2
Binary files /dev/null and b/sw/qa/core/data/ww5/pass/crash-3.doc differ
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 6562bc7..6bdbabf 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -460,23 +460,23 @@ SdrObject* SwWW8ImplReader::ReadPolyLine( WW8_DPHEAD* 
pHd, const WW8_DO* pDo,
 return pObj;
 }
 
-ESelection SwWW8ImplReader::GetESelection( long nCpStart, long nCpEnd )
+ESelection GetESelection(EditEngine rDrawEditEngine, long nCpStart, long 
nCpEnd)
 {
-sal_Int32 nPCnt = mpDrawEditEngine-GetParagraphCount();
+sal_Int32 nPCnt = rDrawEditEngine.GetParagraphCount();
 sal_Int32 nSP = 0;
 sal_Int32 nEP = 0;
 while(  (nSP  nPCnt)
-  (nCpStart = mpDrawEditEngine-GetTextLen( nSP ) + 1) )
+  (nCpStart = rDrawEditEngine.GetTextLen( nSP ) + 1) )
 {
-nCpStart -= mpDrawEditEngine-GetTextLen( nSP ) + 1;
+nCpStart -= rDrawEditEngine.GetTextLen( nSP ) + 1;
 nSP++;
 }
 // Beim Ende erst 1 Zeichen spaeter auf naechste Zeile umschalten,
 // da sonst Zeilenattribute immer eine Zeile zu weit reichen.
 while(  (nEP  nPCnt)
-  (nCpEnd  mpDrawEditEngine-GetTextLen( nEP ) + 1) )
+  (nCpEnd  rDrawEditEngine.GetTextLen( nEP ) + 1) )
 {
-nCpEnd -= mpDrawEditEngine-GetTextLen( nEP ) + 1;
+nCpEnd -= rDrawEditEngine.GetTextLen( nEP ) + 1;
 nEP++;
 }
 return ESelection( nSP, nCpStart, nEP, nCpEnd );
@@ -657,7 +657,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(long 
nStartCp, long nEndCp,
 comphelper::string::padToLength(sTemp,
 nTxtStart - nStartReplace, cReplaceSymbol);
 
mpDrawEditEngine-QuickInsertText(sTemp.makeStringAndClear(),
-GetESelection(nStartReplace - nStartCp,
+GetESelection(*mpDrawEditEngine, nStartReplace - 
nStartCp,
 nTxtStart - nStartCp ) );
 }
 }
@@ -734,7 +734,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(long 
nStartCp, long nEndCp,
 if( pS-Count() )
 {
 mpDrawEditEngine-QuickSetAttribs( *pS,
-GetESelection( nTxtStart - nStartCp, nEnd - nStartCp ) );
+GetESelection(*mpDrawEditEngine, nTxtStart - nStartCp, 
nEnd - nStartCp) );
 delete pS;
 pS = new SfxItemSet(mpDrawEditEngine-GetEmptyItemSet());
 }
@@ -752,7 +752,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(long 
nStartCp, long nEndCp,
 myIter aEnd = aChunks.end();
 for (myIter aIter = aChunks.begin(); aIter != aEnd; ++aIter)
 {
-ESelection aSel(GetESelection(aIter-GetStartPos()-nStartCp,
+ESelection aSel(GetESelection(*mpDrawEditEngine, 
aIter-GetStartPos()-nStartCp,
 aIter-GetEndPos()-nStartCp));
 OUString aString(mpDrawEditEngine-GetText(aSel));
 const sal_Int32 nOrigLen = aString.getLength();
@@ -907,6 +907,47 @@ sal_Int32 
SwWW8ImplReader::GetRangeAsDrawingString(OUString rString, long nStar
 return 0;
 }
 
+//EditEngine::InsertText will replace dos lines resulting in a shorter
+//string than is passed in, so inserting attributes based on the original
+//string len can fail. So here replace the dos line ends similar to
+//how EditEngine does it, but preserve the length and replace the extra
+//chars with placeholders, record the position of the placeholders and
+//remove those extra chars after attributes have been inserted
+std::vectorsal_Int32 replaceDosLineEndsButPreserveLength(OUString rIn)
+{
+OUStringBuffer aNewData(rIn);
+std::vectorsal_Int32 aDosLineEndDummies;
+sal_Int32 i = 0;
+sal_Int32 nStrLen = rIn.getLength();
+while (i  nStrLen)
+{
+// \r or \n causes linebreak
+if (rIn[i] == '\r' || rIn[i] == '\n')
+{
+

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

2015-08-25 Thread Caolán McNamara
 sw/qa/core/data/ww5/pass/hang-1.doc |binary
 sw/source/filter/ww8/ww8scan.cxx|   19 ++-
 sw/source/filter/ww8/ww8scan.hxx|1 +
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 76bd64a9d09e06a38747c25f9ad93dff5376aeaf
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Aug 24 12:36:41 2015 +0100

guard against hangs with bogus unsorted plcfs

This reverts commit 6d21cbd1238556535ec1bb1adf35b25bc8eb898b.

(cherry picked from commit 74c0f74422671f8005f2cfc0ae94e5656bcea31e)

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

diff --git a/sw/qa/core/data/ww5/pass/hang-1.doc 
b/sw/qa/core/data/ww5/pass/hang-1.doc
new file mode 100644
index 000..6033724
Binary files /dev/null and b/sw/qa/core/data/ww5/pass/hang-1.doc differ
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 7b65eb6..0339495 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -2121,7 +2121,9 @@ void WW8PLCF::ReadPLCF(SvStream rSt, WW8_FC nFilePos, 
sal_uInt32 nPLCF)
 nIdx = 0;
 #endif // OSL_BIGENDIAN
 // Pointer to content array
-pPLCF_Contents = (sal_uInt8*)pPLCF_PosArray[nIMax + 1];
+pPLCF_Contents = reinterpret_castsal_uInt8*(pPLCF_PosArray[nIMax + 
1]);
+
+TruncToSortedRange();
 }
 
 OSL_ENSURE(bValid, Document has corrupt PLCF, ignoring it);
@@ -2141,6 +2143,21 @@ void WW8PLCF::MakeFailedPLCF()
 pPLCF_Contents = (sal_uInt8*)pPLCF_PosArray[nIMax + 1];
 }
 
+void WW8PLCF::TruncToSortedRange()
+{
+//Docs state that: ... all Plcs ... are sorted in ascending order.
+//So ensure that here for broken documents.
+for (auto nI = 0; nI  nIMax; ++nI)
+{
+if (pPLCF_PosArray[nI]  pPLCF_PosArray[nI+1])
+{
+SAL_WARN(sw.ww8, Document has unsorted PLCF, truncated to 
sorted portion);
+nIMax = nI;
+break;
+}
+}
+}
+
 void WW8PLCF::GeneratePLCF(SvStream rSt, sal_Int32 nPN, sal_Int32 ncpN)
 {
 OSL_ENSURE( nIMax  ncpN, Pcl.Fkp: Why is PLCF too big? );
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 57e53e9..d931e1c 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -292,6 +292,7 @@ private:
 
 void MakeFailedPLCF();
 
+void TruncToSortedRange();
 public:
 WW8PLCF(SvStream rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
 WW8_CP nStartPos = -1);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-25 Thread Caolán McNamara
 sw/qa/core/data/ww5/pass/hang-2.doc |binary
 sw/source/filter/ww8/ww8scan.cxx|9 -
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 35b895a710b9f43fbffc6ff7dcc461de4663bbba
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Aug 24 14:05:00 2015 +0100

limit seeks to valid area

(cherry picked from commit c0c9075163f06c0b5c2ad9cf428f1cfacf9fe1fb)

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

diff --git a/sw/qa/core/data/ww5/pass/hang-2.doc 
b/sw/qa/core/data/ww5/pass/hang-2.doc
new file mode 100644
index 000..5f76093
Binary files /dev/null and b/sw/qa/core/data/ww5/pass/hang-2.doc differ
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 0339495..366bd31 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -6698,9 +6698,8 @@ WW8Dop::WW8Dop(SvStream rSt, sal_Int16 nFib, sal_Int32 
nPos, sal_uInt32 nSize)
 sal_uInt8* pData = pDataPtr;
 
 sal_uInt32 nRead = nMaxDopSize  nSize ? nMaxDopSize : nSize;
-rSt.Seek( nPos );
-if (2  nSize || nRead != rSt.Read(pData, nRead))
-nDopError = ERR_SWG_READ_ERROR; // Error melden
+if (nSize  2 || !checkSeek(rSt, nPos) || nRead != rSt.Read(pData, nRead))
+nDopError = ERR_SWG_READ_ERROR; // report error
 else
 {
 if (nMaxDopSize  nRead)
@@ -7547,8 +7546,8 @@ SEPr::SEPr() :
 
 bool checkSeek(SvStream rSt, sal_uInt32 nOffset)
 {
-return (nOffset != SAL_MAX_UINT32 
-rSt.Seek(nOffset) == static_castsal_Size(nOffset));
+const sal_uInt64 nMaxSeek(rSt.Tell() + rSt.remainingSize());
+return (nOffset = nMaxSeek  rSt.Seek(nOffset) == nOffset);
 }
 
 bool checkRead(SvStream rSt, void *pDest, sal_uInt32 nLength)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-25 Thread Caolán McNamara
 sw/qa/core/data/ww5/pass/crash-1.doc |binary
 sw/source/filter/ww8/ww8scan.cxx |5 ++---
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit fc8da14e6ec6db437bd2959efd63391c7632a23d
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Aug 24 15:29:54 2015 +0100

loop over successfully read bookmarks

not over the amount that should be there

Change-Id: Ia2c353f9d7e274a5bebf405e1743ef1d1872b4de
(cherry picked from commit 02e9b490a9401744a8a0699ad5dd10281b6b0b30)
Reviewed-on: https://gerrit.libreoffice.org/17960
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/core/data/ww5/pass/crash-1.doc 
b/sw/qa/core/data/ww5/pass/crash-1.doc
new file mode 100644
index 000..5b94b9a
Binary files /dev/null and b/sw/qa/core/data/ww5/pass/crash-1.doc differ
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 366bd31..1a97613 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4142,10 +4142,10 @@ OUString WW8PLCFx_Book::GetBookmark(long nStart,long 
nEnd, sal_uInt16 nIndex)
 {
 bool bFound = false;
 sal_uInt16 i = 0;
-if( pBook[0]  pBook[1] )
+if (pBook[0]  pBook[1])
 {
 WW8_CP nStartAkt, nEndAkt;
-do
+while (i  aBookNames.size())
 {
 void* p;
 sal_uInt16 nEndIdx;
@@ -4168,7 +4168,6 @@ OUString WW8PLCFx_Book::GetBookmark(long nStart,long 
nEnd, sal_uInt16 nIndex)
 }
 ++i;
 }
-while (i  pBook[0]-GetIMax());
 }
 return bFound ? aBookNames[i] : OUString();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-23 Thread Caolán McNamara
 sw/qa/core/data/ww6/pass/crash-7.doc |binary
 sw/source/filter/basflt/fltshell.cxx |   26 ++
 2 files changed, 18 insertions(+), 8 deletions(-)

New commits:
commit e1276f7bd5a396f23856d039f3e79e20aa8232fc
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Aug 23 17:13:23 2015 +0100

check for bad locations

(cherry picked from commit b164d08f0c12a3434fad1b40900ddc8cb510370c)

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

diff --git a/sw/qa/core/data/ww6/pass/crash-7.doc 
b/sw/qa/core/data/ww6/pass/crash-7.doc
new file mode 100644
index 000..5a9dab3
Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-7.doc differ
diff --git a/sw/source/filter/basflt/fltshell.cxx 
b/sw/source/filter/basflt/fltshell.cxx
index 549731a..ef46c21 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -419,25 +419,33 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const 
SwPosition rPos,
 return pRet;
 }
 
-static void MakePoint(const SwFltStackEntry rEntry, SwDoc* pDoc,
+static bool MakePoint(const SwFltStackEntry rEntry, SwDoc* pDoc,
 SwPaM rRegion)
 {
 // the anchor is the Pam's Point. It's modified when inserting
 // text, etc.; therefore it is kept on the stack. Only the
 // attribute's format needs to be set.
 rRegion.DeleteMark();
-rRegion.GetPoint()-nNode = rEntry.m_aMkPos.m_nNode.GetIndex() + 1;
+
+sal_uLong nMk = rEntry.m_aMkPos.m_nNode.GetIndex() + 1;
+const SwNodes rMkNodes = rEntry.m_aMkPos.m_nNode.GetNodes();
+if (nMk = rMkNodes.Count())
+return false;
+
+rRegion.GetPoint()-nNode = nMk;
 SwCntntNode* pCNd = GetCntntNode(pDoc, rRegion.GetPoint()-nNode, true);
 rRegion.GetPoint()-nContent.Assign(pCNd, rEntry.m_aMkPos.m_nCntnt);
+return true;
 }
 
 // MakeBookRegionOrPoint() behaves like MakeRegionOrPoint, except that
 // it adheres to certain restrictions on bookmarks in tables (cannot
 // span more than one cell)
-static void MakeBookRegionOrPoint(const SwFltStackEntry rEntry, SwDoc* pDoc,
+static bool MakeBookRegionOrPoint(const SwFltStackEntry rEntry, SwDoc* pDoc,
 SwPaM rRegion, bool bCheck )
 {
-if (rEntry.MakeRegion(pDoc, rRegion, bCheck )){
+if (rEntry.MakeRegion(pDoc, rRegion, bCheck ))
+{
 // sal_Bool b1 = rNds[rRegion.GetPoint()-nNode]-FindTableNode() != 0;
 if (rRegion.GetPoint()-nNode.GetNode().FindTableBoxStartNode()
   != rRegion.GetMark()-nNode.GetNode().FindTableBoxStartNode())
@@ -445,9 +453,9 @@ static void MakeBookRegionOrPoint(const SwFltStackEntry 
rEntry, SwDoc* pDoc,
 rRegion.Exchange(); // invalid range
 rRegion.DeleteMark();   // - both to mark
 }
-}else{
-MakePoint(rEntry, pDoc, rRegion);
+return true;
 }
+return MakePoint(rEntry, pDoc, rRegion);
 }
 
 // IterateNumrulePiece() looks for the first range valid for Numrules
@@ -596,8 +604,10 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition 
rTmpPos,
 break;
 case RES_FLTR_ANNOTATIONMARK:
 {
-MakeBookRegionOrPoint(rEntry, pDoc, aRegion, true);
-pDoc-getIDocumentMarkAccess()-makeAnnotationMark(aRegion, 
OUString());
+if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion, true))
+pDoc-getIDocumentMarkAccess()-makeAnnotationMark(aRegion, 
OUString());
+else
+SAL_WARN(sw, failed to make book region or point);
 }
 break;
 case RES_FLTR_TOX:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-23 Thread Caolán McNamara
 sw/qa/core/data/ww6/pass/crash-6.doc |binary
 sw/source/filter/basflt/fltshell.cxx |   13 ++---
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 4efb0056f24698516aa5550ec926255da45a2381
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Aug 22 10:31:35 2015 +0100

check that src index is in doc range

(cherry picked from commit 3230c8cf1cf2dc486f038d369e7f4f44ffd6b0a7)

check that dest index is in doc range

(cherry picked from commit cd6c9aef7468120dd5ea5c747f35c98baf214613)

Change-Id: Ic81e7a14701ff30aa46a9293dd6db351bd350ba5
3006cf03cf97399a6c418162178acdb1d41c3b23
Reviewed-on: https://gerrit.libreoffice.org/17928
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/core/data/ww6/pass/crash-6.doc 
b/sw/qa/core/data/ww6/pass/crash-6.doc
new file mode 100644
index 000..08c8791
Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-6.doc differ
diff --git a/sw/source/filter/basflt/fltshell.cxx 
b/sw/source/filter/basflt/fltshell.cxx
index 53a9b66..549731a 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -120,8 +120,11 @@ bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM 
rRegion, bool bCheck,
 
 // The only position of 0x0D will not be able to make region in the old 
logic
 // because it is beyond the length of para...need special consideration 
here.
-SwCntntNode *const pCntntNode(
-SwNodeIndex(rMkPos.m_nNode, +1).GetNode().GetCntntNode());
+sal_uLong nMk = rMkPos.m_nNode.GetIndex() + 1;
+const SwNodes rMkNodes = rMkPos.m_nNode.GetNodes();
+if (nMk = rMkNodes.Count())
+return false;
+SwCntntNode *const pCntntNode(rMkNodes[nMk]-GetCntntNode());
 if (rMkPos == rPtPos 
 ((0 != rPtPos.m_nCntnt) || (pCntntNode  (0 != pCntntNode-Len(
  ( RES_TXTATR_FIELD != nWhich
@@ -138,7 +141,11 @@ bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM 
rRegion, bool bCheck,
 rRegion.SetMark();
 if (rMkPos.m_nNode != rPtPos.m_nNode)
 {
-rRegion.GetPoint()-nNode = rPtPos.m_nNode.GetIndex() + 1;
+sal_uLong n = rPtPos.m_nNode.GetIndex() + 1;
+SwNodes rNodes = rRegion.GetPoint()-nNode.GetNodes();
+if (n = rNodes.Count())
+return false;
+rRegion.GetPoint()-nNode = n;
 pCNd = GetCntntNode(pDoc, rRegion.GetPoint()-nNode, false);
 }
 rRegion.GetPoint()-nContent.Assign(pCNd, rPtPos.m_nCntnt);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-23 Thread Caolán McNamara
 sw/qa/core/data/ww6/pass/hang-1.doc |binary
 sw/source/filter/ww8/ww8par.cxx |2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 44c27bfb62ee9e820b659132ad9f8799b67064cc
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Aug 21 14:01:03 2015 +0100

avoid hang in certain ww6 docs

(cherry picked from commit d0813b432f94d214a6961cb6a1eb11f65399e59b)

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

diff --git a/sw/qa/core/data/ww6/pass/hang-1.doc 
b/sw/qa/core/data/ww6/pass/hang-1.doc
new file mode 100644
index 000..825283d
Binary files /dev/null and b/sw/qa/core/data/ww6/pass/hang-1.doc differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 8f8c00b..e922037 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3880,7 +3880,7 @@ void SwWW8ImplReader::ReadAttrs(WW8_CP rTxtPos, WW8_CP 
rNext, long nTextEnd, b
 {
 maCurrAttrCP = rTxtPos;
 rNext = ReadTextAttr(rTxtPos, nTextEnd, rbStartLine);
-if (rTxtPos == rNext  rTxtPos == WW8_CP_MAX)
+if (rTxtPos == rNext  rTxtPos = nTextEnd)
 break;
 }
 while( rTxtPos = rNext );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-21 Thread Caolán McNamara
 sw/qa/core/data/ww6/pass/crash-1.doc |binary
 sw/qa/core/filters-test.cxx  |4 
 sw/source/filter/ww8/ww8par2.cxx |   29 -
 3 files changed, 20 insertions(+), 13 deletions(-)

New commits:
commit 266b2e777de0a5d82a7bd493d486f208710e7f4f
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Aug 21 09:52:29 2015 +0100

add ww6 test dir and fix a crash

Change-Id: Id08176640672095c03e0b124cd65a9dce26ac2db
(cherry picked from commit 42a709d1ef647aab9a1c9422b4e25ecaee857aba)
Reviewed-on: https://gerrit.libreoffice.org/17890
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/core/data/ww6/fail/.gitignore 
b/sw/qa/core/data/ww6/fail/.gitignore
new file mode 100644
index 000..e69de29
diff --git a/sw/qa/core/data/ww6/indeterminate/.gitignore 
b/sw/qa/core/data/ww6/indeterminate/.gitignore
new file mode 100644
index 000..e69de29
diff --git a/sw/qa/core/data/ww6/pass/.gitignore 
b/sw/qa/core/data/ww6/pass/.gitignore
new file mode 100644
index 000..e69de29
diff --git a/sw/qa/core/data/ww6/pass/crash-1.doc 
b/sw/qa/core/data/ww6/pass/crash-1.doc
new file mode 100644
index 000..3c6f684
Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-1.doc differ
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index 527f3ae..852bced 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -151,6 +151,10 @@ void SwFiltersTest::testCVEs()
 getURLFromSrc(/sw/qa/core/data/ww8/),
 OUString(FILTER_WW8));
 
+testDir(OUString(MS WinWord 6.0),
+getURLFromSrc(/sw/qa/core/data/ww6/),
+OUString(sWW6));
+
 testDir(OUString(MS WinWord 5),
 getURLFromSrc(/sw/qa/core/data/ww5/),
 OUString(sWW5));
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index b81f630..25d7839 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -4274,6 +4274,14 @@ void WW8RStyle::ImportOldFormatStyles()
 std::vector std::vectorsal_uInt8  aConvertedChpx;
 while (nByteCount  cbChpx)
 {
+if (stcp == aCHPXOffsets.size())
+{
+//more data than style slots, skip remainder
+rSt.SeekRel(cbChpx-nByteCount);
+nByteCount += cbChpx-nByteCount;
+break;
+}
+
 sal_uInt8 cb(0);
 rSt.ReadUChar( cb );
 nByteCount++;
@@ -4296,12 +4304,7 @@ void WW8RStyle::ImportOldFormatStyles()
 else
 aConvertedChpx.push_back( std::vectorsal_uInt8() );
 
-stcp++;
-if (stcp == nStyles)
-{
-rSt.SeekRel(cbChpx-nByteCount);
-nByteCount += cbChpx-nByteCount;
-}
+++stcp;
 }
 
 std::vectorpxoffset aPAPXOffsets(stcp);
@@ -4318,6 +4321,12 @@ void WW8RStyle::ImportOldFormatStyles()
 stcp=0;
 while (nByteCount  cbPapx)
 {
+if (stcp == aPAPXOffsets.size())
+{
+rSt.SeekRel(cbPapx-nByteCount);
+nByteCount += cbPapx-nByteCount;
+}
+
 sal_uInt8 cb(0);
 rSt.ReadUChar( cb );
 nByteCount++;
@@ -4339,13 +4348,7 @@ void WW8RStyle::ImportOldFormatStyles()
 nByteCount += nRemainder;
 }
 
-stcp++;
-
-if (stcp == nStyles)
-{
-rSt.SeekRel(cbPapx-nByteCount);
-nByteCount += cbPapx-nByteCount;
-}
+++stcp;
 }
 
 sal_uInt16 iMac(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-4' - sw/qa sw/source

2015-08-21 Thread Caolán McNamara
 sw/qa/core/data/ww6/pass/crash-2.doc |binary
 sw/source/filter/ww8/ww8graf.cxx |   15 ---
 sw/source/filter/ww8/ww8par.hxx  |2 +-
 3 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit e9ef67d14422d7a41ec2d01c52a43c9bbdfe5c54
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Aug 21 11:27:06 2015 +0100

if read string was truncated, then truncate attributes range to match

(cherry picked from commit 6071feec26743dacff1060658e57d5cf62cde2a8)

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

diff --git a/sw/qa/core/data/ww6/pass/crash-2.doc 
b/sw/qa/core/data/ww6/pass/crash-2.doc
new file mode 100644
index 000..f155e97
Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-2.doc differ
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 34c5795..cf0f39b 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -881,7 +881,7 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP rStartCp, 
WW8_CP rEndCp,
 
 // TxbxText() holt aus WW-File den Text und gibt diesen und den Anfangs- und
 // den um -2 (bzw. -1 bei Ver8) korrigierten End-Cp zurueck
-bool SwWW8ImplReader::GetRangeAsDrawingString(OUString rString, long 
nStartCp, long nEndCp, ManTypes eType)
+sal_Int32 SwWW8ImplReader::GetRangeAsDrawingString(OUString rString, long 
nStartCp, long nEndCp, ManTypes eType)
 {
 WW8_CP nOffset = pWwFib-GetBaseCp(eType);
 
@@ -900,23 +900,24 @@ bool SwWW8ImplReader::GetRangeAsDrawingString(OUString 
rString, long nStartCp,
 rString = rString.copy(0, nLen-1);
 
 rString = rString.replace( 0xb, 0xa );
-return true;
+return nLen;
 }
 }
-return false;
+return 0;
 }
 
 OutlinerParaObject* SwWW8ImplReader::ImportAsOutliner(OUString rString, 
WW8_CP nStartCp, WW8_CP nEndCp, ManTypes eType)
 {
 OutlinerParaObject* pRet = 0;
 
-if (GetRangeAsDrawingString( rString, nStartCp, nEndCp, eType ))
+sal_Int32 nLen = GetRangeAsDrawingString(rString, nStartCp, nEndCp, eType);
+if (nLen  0)
 {
 if (!mpDrawEditEngine)
 mpDrawEditEngine = new EditEngine(0);
 
 mpDrawEditEngine-SetText(rString);
-InsertAttrsAsDrawingAttrs(nStartCp, nEndCp, eType);
+InsertAttrsAsDrawingAttrs(nStartCp, nStartCp+nLen, eType);
 
 // Annotations typically begin with a (useless) 0x5
 if ((eType == MAN_AND)  mpDrawEditEngine-GetTextLen())
@@ -966,8 +967,8 @@ SwFrmFmt* SwWW8ImplReader::InsertTxbxText(SdrTextObj* 
pTextObj,
 OUString aString;
 WW8_CP nStartCp, nEndCp;
 bool bContainsGraphics = false;
-bool bTextWasRead = GetTxbxTextSttEndCp( nStartCp, nEndCp, nTxBxS,
-nSequence )  GetRangeAsDrawingString( aString, nStartCp, nEndCp, 
eType );
+bool bTextWasRead = GetTxbxTextSttEndCp(nStartCp, nEndCp, nTxBxS, 
nSequence) 
+GetRangeAsDrawingString(aString, nStartCp, nEndCp, 
eType)  0;
 
 if (!mpDrawEditEngine)
 mpDrawEditEngine = new EditEngine(0);
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index d9bfe92..179e05f 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1608,7 +1608,7 @@ private:
 
 bool GetTxbxTextSttEndCp(WW8_CP rStartCp, WW8_CP rEndCp, sal_uInt16 
nTxBxS,
 sal_uInt16 nSequence);
-bool GetRangeAsDrawingString(OUString rString, long StartCp, long nEndCp, 
ManTypes eType);
+sal_Int32 GetRangeAsDrawingString(OUString rString, long StartCp, long 
nEndCp, ManTypes eType);
 OutlinerParaObject* ImportAsOutliner(OUString rString, WW8_CP nStartCp, 
WW8_CP nEndCp, ManTypes eType);
 SwFrmFmt* InsertTxbxText(SdrTextObj* pTextObj, Size* pObjSiz,
 sal_uInt16 nTxBxS, sal_uInt16 nSequence, long nPosCp, SwFrmFmt* 
pFlyFmt,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-21 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/hang-5.doc |binary
 sw/source/filter/ww8/ww8par.cxx |5 +++--
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit c859dde22469c683337220765e764b5198d00158
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Aug 20 20:55:25 2015 +0100

clip text to skip to max text available

(cherry picked from commit 684a210dd44ba5bb239eb07842ced767059a3fb8)

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

diff --git a/sw/qa/core/data/ww8/pass/hang-5.doc 
b/sw/qa/core/data/ww8/pass/hang-5.doc
new file mode 100644
index 000..c9d5671
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-5.doc differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index b7c8bbb..8f8c00b 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3783,8 +3783,9 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP rTxtPos, long 
nTextEnd, bool rbStart
 (aRes.nSprmId == eFLD) || (aRes.nSprmId == eAND)
)
 {
-// Skip Field/Ftn-/End-Note here
-rTxtPos += nSkipChars;
+WW8_CP nMaxLegalSkip = nTextEnd - rTxtPos;
+// Skip Field/Footnote-/End-Note here
+rTxtPos += std::minWW8_CP(nSkipChars, nMaxLegalSkip);
 nSkipPos = rTxtPos-1;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-21 Thread Caolán McNamara
 sw/qa/core/data/ww6/pass/crash-4.doc |binary
 sw/source/filter/ww8/ww8par2.cxx |3 +++
 2 files changed, 3 insertions(+)

New commits:
commit 319d725c73b8bf60158961aa0b014258708effab
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Aug 21 13:26:44 2015 +0100

don't crash due to earlier short reads

Change-Id: I682a9bf72cbe18999c0c5acc495e813727e0e372
(cherry picked from commit 0030efe09ad9447933ac3b1875c270ed1649aee7)
Reviewed-on: https://gerrit.libreoffice.org/17903
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/core/data/ww6/pass/crash-4.doc 
b/sw/qa/core/data/ww6/pass/crash-4.doc
new file mode 100644
index 000..5abaecc
Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-4.doc differ
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 16273ed..f214746 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -4380,6 +4380,9 @@ void WW8RStyle::ImportOldFormatStyles()
 if (eSti == ww::stiNil)
 continue;
 
+if (stcp = aPAPXOffsets.size())
+continue;
+
 rSI.bValid = true;
 
 if (ww::StandardStiIsCharStyle(eSti)  !aPAPXOffsets[stcp].mnSize)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-21 Thread Caolán McNamara
 sw/qa/core/data/ww6/pass/crash-3.doc |binary
 sw/source/filter/ww8/ww8par2.cxx |1 +
 2 files changed, 1 insertion(+)

New commits:
commit 72dbb1bb9c83f85050a892bc0886f0f2a56a3f51
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Aug 21 13:04:57 2015 +0100

fix another ww6 crash

Change-Id: I47b4ffb1d96041d51dde313c080ed1d9cd4000be
(cherry picked from commit 6405203750f7f779a3655bc5f415e8e0a2071d1b)
Reviewed-on: https://gerrit.libreoffice.org/17898
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/core/data/ww6/pass/crash-3.doc 
b/sw/qa/core/data/ww6/pass/crash-3.doc
new file mode 100644
index 000..8646b7a
Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-3.doc differ
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 25d7839..16273ed 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -4325,6 +4325,7 @@ void WW8RStyle::ImportOldFormatStyles()
 {
 rSt.SeekRel(cbPapx-nByteCount);
 nByteCount += cbPapx-nByteCount;
+break;
 }
 
 sal_uInt8 cb(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-4' - sw/qa sw/source

2015-08-20 Thread Miklos Vajna
 sw/qa/extras/uiwriter/data/tdf89720.odt |binary
 sw/qa/extras/uiwriter/uiwriter.cxx  |   21 +
 sw/source/uibase/docvw/SidebarWin.cxx   |3 ++-
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 7ef02b34a47869a582dfd1dc6c1291e20c029eed
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Jul 30 09:11:35 2015 +0200

tdf#89720 sw: do not create text range overlay for reply annotations

Regression from commit 0761f81643a6890457e9ef7d913ab5c88c2593a4 (123792:
complete annotations on text ranges feature, 2013-12-19), the problem
was that in case a comment had a reply, then both comments produced its
range overlay, and this repeated semi-transparent overlay resulted in
dark color.

Go back to the old behavior of just painting the overlay for the
non-reply comment; for real, partly overlapping comments showing the
exact boundaries of the overlapping overlays still makes sense.

(cherry picked from commit 780dd8c1cf5302ca503cf7b55357dace4d69beb9)

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

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

diff --git a/sw/qa/extras/uiwriter/data/tdf89720.odt 
b/sw/qa/extras/uiwriter/data/tdf89720.odt
new file mode 100644
index 000..0b86ec5
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf89720.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index b7d0157..e78dc88 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -23,6 +23,9 @@
 #include textboxhelper.hxx
 #include view.hxx
 #include hhcwrp.hxx
+#include postithelper.hxx
+#include PostItMgr.hxx
+#include SidebarWin.hxx
 
 #include svx/svdpage.hxx
 #include svx/svdview.hxx
@@ -61,6 +64,7 @@ public:
 void testBookmarkUndo();
 void testCp1000115();
 void testDde();
+void testTdf89720();
 
 CPPUNIT_TEST_SUITE(SwUiWriterTest);
 CPPUNIT_TEST(testReplaceForward);
@@ -87,6 +91,7 @@ public:
 CPPUNIT_TEST(testBookmarkUndo);
 CPPUNIT_TEST(testCp1000115);
 CPPUNIT_TEST(testDde);
+CPPUNIT_TEST(testTdf89720);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -679,6 +684,22 @@ void SwUiWriterTest::testDde()
 CPPUNIT_ASSERT(xField-getString().endsWith(asdf));
 }
 
+void SwUiWriterTest::testTdf89720()
+{
+#ifndef MACOSX
+SwDoc* pDoc = createDoc(tdf89720.odt);
+SwView* pView = pDoc-GetDocShell()-GetView();
+SwPostItMgr* pPostItMgr = pView-GetPostItMgr();
+for (SwSidebarItem* pItem : *pPostItMgr)
+{
+if (pItem-pPostIt-IsFollow())
+// This was non-0: reply comments had a text range overlay,
+// resulting in unexpected dark color.
+CPPUNIT_ASSERT(!pItem-pPostIt-TextRange());
+}
+#endif
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx 
b/sw/source/uibase/docvw/SidebarWin.cxx
index 84d9974..4bfb394 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -702,8 +702,9 @@ void SwSidebarWin::SetPosAndSize()
 mpTextRangeOverlay-HideSolidBorder();
 }
 }
-else
+else if (!IsFollow())
 {
+// This window is not a reply, then draw its range overlay.
 mpTextRangeOverlay =
 sw::overlay::OverlayRanges::CreateOverlayRange(
 DocView(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-20 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/crash-3.doc |binary
 sw/source/filter/ww8/ww8par.cxx  |   13 ++---
 sw/source/filter/ww8/ww8scan.cxx |8 
 sw/source/filter/ww8/ww8scan.hxx |2 +-
 4 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit eb64a9b38d5f98dca9de71e26598d839fd5eb535
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Aug 20 09:31:30 2015 +0100

sanitize lcbCmds length

(cherry picked from commit 721f5b054e013cc2867051bef75d6488fdb583a8)

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

diff --git a/sw/qa/core/data/ww8/pass/crash-3.doc 
b/sw/qa/core/data/ww8/pass/crash-3.doc
new file mode 100644
index 000..d36afef
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/crash-3.doc differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 7ccb338..b7c8bbb 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4650,15 +4650,14 @@ void SwWW8ImplReader::StoreMacroCmds()
 {
 uno::Reference  io::XStream  xStream =
 xRoot-openStreamElement( OUString(SL::aMSMacroCmds), 
embed::ElementModes::READWRITE );
-SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( xStream 
);
+std::unique_ptrSvStream 
xOutStream(::utl::UcbStreamHelper::CreateStream(xStream));
 
-sal_uInt8 *pBuffer = new sal_uInt8[pWwFib-lcbCmds];
-pWwFib-lcbCmds = pTableStream-Read(pBuffer, pWwFib-lcbCmds);
-pStream-Write(pBuffer, pWwFib-lcbCmds);
-delete[] pBuffer;
-delete pStream;
+sal_uInt32 lcbCmds = std::minsal_uInt32(pWwFib-lcbCmds, 
pTableStream-remainingSize());
+std::unique_ptrsal_uInt8[] xBuffer(new sal_uInt8[lcbCmds]);
+pWwFib-lcbCmds = pTableStream-Read(xBuffer.get(), lcbCmds);
+xOutStream-Write(xBuffer.get(), pWwFib-lcbCmds);
 }
-catch ( const uno::Exception )
+catch (...)
 {
 }
 }
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index b77936e..b3a9b1d 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -5185,14 +5185,14 @@ namespace
 {
 if (eVer = ww::eWW2)
 {
-sal_uInt16 nShort;
-rSt.ReadUInt16( nShort );
+sal_uInt16 nShort(0);
+rSt.ReadUInt16(nShort);
 return nShort;
 }
 else
 {
-sal_uInt32 nLong;
-rSt.ReadUInt32( nLong );
+sal_uInt32 nLong(0);
+rSt.ReadUInt32(nLong);
 return nLong;
 }
 }
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index e054b9d..57e53e9 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -1281,7 +1281,7 @@ public:
 sal_Int32 lcbPlcfbkl;   // 0x114 sal_Int32
 
 WW8_FC fcCmds;  // 0x118 FC
-sal_Int32 lcbCmds;  // 0x11c
+sal_uInt32 lcbCmds;  // 0x11c
 
 WW8_FC fcPlcfmcr;   // 0x120 FC
 sal_Int32 lcbPlcfmcr;   // 0x124
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-17 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/tdf86374.docx|binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |   10 ++
 writerfilter/inc/resourcemodel/TableManager.hxx|2 ++
 writerfilter/source/dmapper/TablePropertiesHandler.cxx |   10 --
 4 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 41086e24ecf5a43646aae0c5d5a66b3e3f483195
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jul 22 09:24:06 2015 +0200

tdf#86374 DOCX import: fix btLr text table direction without w:cantSplit/

Commit 0208ead70a9412ccd554fcef3e9308f8ca17037b (DOCX import: improve
btLr table cell support, 2013-02-22) made any table row that has at
least one btLr cell fixed height. This causes problems in case a table
has a minimal height with lots of content, where the fixed height gives
wrong layout, but the minimal height is correct.

Fix the problem by only making the row fixed height if w:cantSplit/ is
set (as seen in the old bugdoc), and revert to setting the height type
to minimal in any other case.

(cherry picked from commit 233a634a112e6dae07dca5fb1296764cb0001503)

Conflicts:
writerfilter/source/dmapper/TableManager.hxx

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

diff --git a/sw/qa/extras/ooxmlimport/data/tdf86374.docx 
b/sw/qa/extras/ooxmlimport/data/tdf86374.docx
new file mode 100644
index 000..7fd772d
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf86374.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index ced25ac..c1ef511 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2623,6 +2623,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf89702, tdf89702.docx)
 CPPUNIT_ASSERT_EQUAL(OUString(Arial), getPropertyOUString(xStyle, 
CharFontName));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf86374, tdf86374.docx)
+{
+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::Referencetable::XTableRows xTableRows(xTable-getRows(), 
uno::UNO_QUERY);
+// btLr text direction was imported as FIX, it should be MIN to have 
enough space for the additionally entered paragraphs.
+CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, 
getPropertysal_Int16(xTableRows-getByIndex(0), SizeType));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/inc/resourcemodel/TableManager.hxx 
b/writerfilter/inc/resourcemodel/TableManager.hxx
index c13303c..9e06575 100644
--- a/writerfilter/inc/resourcemodel/TableManager.hxx
+++ b/writerfilter/inc/resourcemodel/TableManager.hxx
@@ -315,6 +315,7 @@ protected:
 mState.resetCellProps();
 }
 
+public:
 PropertiesPointer getRowProps()
 {
 return mState.getRowProps();
@@ -330,6 +331,7 @@ protected:
 mState.resetRowProps();
 }
 
+protected:
 void setInCell(bool bInCell)
 {
 mState.setInCell(bInCell);
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx 
b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
index c951612..453aec9 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
@@ -103,8 +103,14 @@ namespace dmapper {
 const int MINLAY = 23; // sw/inc/swtypes.hxx, minimal 
possible size of frames.
 if (!pManager || !pManager-HasBtlrCell() || 
pMeasureHandler-getMeasureValue()  
ConversionHelper::convertTwipToMM100(MINLAY))
 {
-// In case a cell already wanted fixed size, we should 
not overwrite it here.
-if (!pManager || !pManager-IsRowSizeTypeInserted())
+bool bCantSplit = false;
+if (pManager  pManager-getRowProps())
+{
+boost::optionalPropertyMap::Property 
oIsSplitAllowed = pManager-getRowProps()-getProperty(PROP_IS_SPLIT_ALLOWED);
+bCantSplit = oIsSplitAllowed  
!oIsSplitAllowed-second.getbool();
+}
+// In case a cell already wanted fixed size and the 
row has w:cantSplit/, we should not overwrite it here.
+if (!pManager || !pManager-IsRowSizeTypeInserted() || 
!bCantSplit)
 pPropMap-Insert( PROP_SIZE_TYPE, uno::makeAny( 
pMeasureHandler-GetRowHeightSizeType() ), false);
 else
 pPropMap-Insert( PROP_SIZE_TYPE, 

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

2015-08-17 Thread Miklos Vajna
 sw/qa/extras/uiwriter/uiwriter.cxx|   40 ++
 sw/source/core/doc/DocumentLinksAdministrationManager.cxx |3 -
 2 files changed, 41 insertions(+), 2 deletions(-)

New commits:
commit c7498f49e981e91ae45da12bbc2823da254b9c5d
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jul 27 09:16:16 2015 +0200

tdf#90575 sw: fix pasting DDE links

Regression from commit 0761f81643a6890457e9ef7d913ab5c88c2593a4 (123792:
complete annotations on text ranges feature, 2013-12-19), the problem
was that the added additional IDocumentMarkAccess::GetType() check in
lcl_FindDdeBookmark(), which means that the function no longer finds
bookmarks with the matching name, only real DDE marks. This is a
problem, as SwTrnsfrDdeLink::WriteData() depends on the fact that
sw::mark::Bookmark inherits from sw::mark::DdeBookmark. As a result, the
fast IDocumentMarkAccess::GetType() (that intentionally doesn't handle
inheritance for performance reasons) can't be used here.

(cherry picked from commit e06e2cb18874987d2dafd4faa0a8b71fc0aa6453)

Conflicts:
sw/qa/extras/uiwriter/uiwriter.cxx
sw/source/core/doc/DocumentLinksAdministrationManager.cxx

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

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 512095e..b7d0157 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -7,6 +7,7 @@
  */
 
 #include com/sun/star/i18n/TextConversionOption.hpp
+#include com/sun/star/frame/DispatchHelper.hpp
 #include swmodeltestbase.hxx
 #include ndtxt.hxx
 #include wrtsh.hxx
@@ -59,6 +60,7 @@ public:
 void testFdo85554();
 void testBookmarkUndo();
 void testCp1000115();
+void testDde();
 
 CPPUNIT_TEST_SUITE(SwUiWriterTest);
 CPPUNIT_TEST(testReplaceForward);
@@ -84,6 +86,7 @@ public:
 CPPUNIT_TEST(testFdo85554);
 CPPUNIT_TEST(testBookmarkUndo);
 CPPUNIT_TEST(testCp1000115);
+CPPUNIT_TEST(testDde);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -639,6 +642,43 @@ void SwUiWriterTest::testCp1000115()
 xmlXPathFreeObject(pXmlObj);
 }
 
+void lcl_dispatchCommand(const uno::Referencelang::XComponent xComponent, 
const OUString rCommand, const uno::Sequencebeans::PropertyValue 
rPropertyValues)
+{
+uno::Referenceframe::XController xController = 
uno::Referenceframe::XModel(xComponent, 
uno::UNO_QUERY)-getCurrentController();
+CPPUNIT_ASSERT(xController.is());
+uno::Referenceframe::XDispatchProvider xFrame(xController-getFrame(), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xFrame.is());
+
+uno::Referenceuno::XComponentContext xContext = 
::comphelper::getProcessComponentContext();
+uno::Referenceframe::XDispatchHelper 
xDispatchHelper(frame::DispatchHelper::create(xContext));
+CPPUNIT_ASSERT(xDispatchHelper.is());
+
+xDispatchHelper-executeDispatch(xFrame, rCommand, OUString(), 0, 
rPropertyValues);
+}
+
+void SwUiWriterTest::testDde()
+{
+// Type asdf and copy it.
+SwDoc* pDoc = createDoc();
+SwWrtShell* pWrtShell = pDoc-GetDocShell()-GetWrtShell();
+pWrtShell-Insert(asdf);
+pWrtShell-Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 4, 
/*bBasicCall=*/false);
+uno::Sequencebeans::PropertyValue aPropertyValues;
+lcl_dispatchCommand(mxComponent, .uno:Copy, aPropertyValues);
+
+// Go before the selection and paste as a DDE link.
+pWrtShell-Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+aPropertyValues = uno::Sequencebeans::PropertyValue(1);
+aPropertyValues[0].Name = SelectedFormat;
+aPropertyValues[0].Value = 
uno::makeAny(static_castsal_uInt32(SOT_FORMATSTR_ID_LINK));
+lcl_dispatchCommand(mxComponent, .uno:ClipboardFormatItems, 
aPropertyValues);
+
+// Make sure that the document starts with a field now, and its expanded 
string value contains asdf.
+const uno::Reference text::XTextRange  xField = getRun(getParagraph(1), 
1);
+CPPUNIT_ASSERT_EQUAL(OUString(TextField), getPropertyOUString(xField, 
TextPortionType));
+CPPUNIT_ASSERT(xField-getString().endsWith(asdf));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx 
b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
index 086dd42..17f2d338 100644
--- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
+++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
@@ -98,9 +98,8 @@ namespace
 ppMark != rMarkAccess.getAllMarksEnd();
 ++ppMark)
 {
-if ( IDocumentMarkAccess::GetType( *(ppMark-get()) ) == 
IDocumentMarkAccess::DDE_BOOKMARK)
+if (::sw::mark::DdeBookmark* const pBkmk = dynamic_cast 

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

2015-08-17 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/crash-2.doc |binary
 sw/source/filter/ww8/WW8Sttbf.cxx|2 ++
 2 files changed, 2 insertions(+)

New commits:
commit 20e5a9e8c07ca7462b770449f3e329c1ba09eba3
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Aug 16 14:20:54 2015 +0100

clip Sttbf to available data

Change-Id: Iaa6a8a8505a28cf3c24a48f832bfc618b39c3f32
(cherry picked from commit 12143f8f84b07057d67d5cd6cc9ff6063dfa41f8)
Reviewed-on: https://gerrit.libreoffice.org/17785
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/core/data/ww8/pass/crash-2.doc 
b/sw/qa/core/data/ww8/pass/crash-2.doc
new file mode 100644
index 000..452e21e
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/crash-2.doc differ
diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx 
b/sw/source/filter/ww8/WW8Sttbf.cxx
index 0fa8903..7e1f82c 100644
--- a/sw/source/filter/ww8/WW8Sttbf.cxx
+++ b/sw/source/filter/ww8/WW8Sttbf.cxx
@@ -36,6 +36,8 @@ namespace ww8
 {
 if (checkSeek(rSt, nPos))
 {
+sal_Size nRemainingSize = rSt.remainingSize();
+nSize = std::minsal_uInt32(nRemainingSize, nSize);
 mp_data.reset(new sal_uInt8[nSize]);
 mn_size = rSt.Read(mp_data.get(), nSize);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-12 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/hang-2.doc |binary
 sw/source/filter/ww8/ww8par.cxx |   16 
 sw/source/filter/ww8/ww8par.hxx |   12 ++--
 sw/source/filter/ww8/ww8scan.cxx|5 -
 4 files changed, 22 insertions(+), 11 deletions(-)

New commits:
commit a2bb377a978c4e8151d90f48cad17de06a3c3d54
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Aug 11 09:49:04 2015 +0100

avoid hang with certain .docs

(cherry picked from commit 9b0cd9196e05ab465ebf14a6264d087df224fb55)

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

diff --git a/sw/qa/core/data/ww8/pass/hang-2.doc 
b/sw/qa/core/data/ww8/pass/hang-2.doc
new file mode 100644
index 000..6940c89
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-2.doc differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 7489ca5..0215253 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2141,7 +2141,7 @@ void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr )
 }
 
 void SwWW8ImplReader::Read_HdFtFtnText( const SwNodeIndex* pSttIdx,
-long nStartCp, long nLen, ManTypes nType )
+WW8_CP nStartCp, WW8_CP nLen, ManTypes nType )
 {
 // Saves Flags (amongst other things) and resets them
 WW8ReaderSave aSave( this );
@@ -2228,7 +2228,7 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
 return 0;
 }
 
-void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(long nStart, long nLen,
+void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(WW8_CP nStart, WW8_CP nLen,
 SwFrmFmt rHdFtFmt, sal_uInt16 nPageWidth)
 {
 const SwNodeIndex* pSttIdx = rHdFtFmt.GetCntnt().GetCntntIdx();
@@ -2272,7 +2272,7 @@ void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(long 
nStart, long nLen,
 MoveOutsideFly(pFrame, aTmpPos);
 }
 
-void SwWW8ImplReader::Read_HdFtText(long nStart, long nLen, SwFrmFmt* pHdFtFmt)
+void SwWW8ImplReader::Read_HdFtText(WW8_CP nStart, WW8_CP nLen, SwFrmFmt* 
pHdFtFmt)
 {
 const SwNodeIndex* pSttIdx = pHdFtFmt-GetCntnt().GetCntntIdx();
 if (!pSttIdx)
@@ -3877,6 +3877,8 @@ void SwWW8ImplReader::ReadAttrs(WW8_CP rNext, WW8_CP 
rTxtPos, bool rbStartLin
 {
 maCurrAttrCP = rTxtPos;
 rNext = ReadTextAttr( rTxtPos, rbStartLine );
+if (rTxtPos == rNext  rTxtPos == WW8_CP_MAX)
+break;
 }
 while( rTxtPos = rNext );
 
@@ -3918,7 +3920,7 @@ void SwWW8ImplReader::CloseAttrEnds()
 EndSpecial();
 }
 
-bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType)
+bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes 
nType)
 {
 bool bJoined=false;
 
@@ -3944,6 +3946,12 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long 
nTextLen, ManTypes nType)
 pStrm-Seek( pSBase-WW8Cp2Fc( nStartCp + nCpOfs, bIsUnicode ) );
 
 WW8_CP l = nStartCp;
+const WW8_CP nMaxPossible = WW8_CP_MAX-nStartCp;
+if (nTextLen  nMaxPossible)
+{
+SAL_WARN_IF(nTextLen  nMaxPossible, sw.ww8, TextLen too long);
+nTextLen = nMaxPossible;
+}
 while ( lnStartCp+nTextLen )
 {
 ReadAttrs( nNext, l, bStartLine );// Takes SectionBreaks into account, 
too
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index b3f5c16..34f1ff4 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1403,9 +1403,9 @@ private:
 
 void Read_HdFt(int nSect, const SwPageDesc *pPrev,
 const wwSection rSection);
-void Read_HdFtText(long nStartCp, long nLen, SwFrmFmt* pHdFtFmt);
-void Read_HdFtTextAsHackedFrame(long nStart, long nLen,
-SwFrmFmt rHdFtFmt, sal_uInt16 nPageWidth);
+void Read_HdFtText(WW8_CP nStartCp, WW8_CP nLen, SwFrmFmt* pHdFtFormat);
+void Read_HdFtTextAsHackedFrame(WW8_CP nStart, WW8_CP nLen,
+SwFrmFmt rHdFtFormat, sal_uInt16 nPageWidth);
 
 bool isValid_HdFt_CP(WW8_CP nHeaderCP) const;
 
@@ -1442,13 +1442,13 @@ private:
 long ReadTextAttr(WW8_CP rTxtPos, bool rbStartLine);
 void ReadAttrs(WW8_CP rNext, WW8_CP rTxtPos, bool rbStartLine);
 void CloseAttrEnds();
-bool ReadText(long nStartCp, long nTextLen, ManTypes nType);
+bool ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType);
 
 void ReadRevMarkAuthorStrTabl( SvStream rStrm, sal_Int32 nTblPos,
 sal_Int32 nTblSiz, SwDoc rDoc );
 
-void Read_HdFtFtnText( const SwNodeIndex* pSttIdx, long nStartCp,
-   long nLen, ManTypes nType );
+void Read_HdFtFtnText( const SwNodeIndex* pSttIdx, WW8_CP nStartCp,
+   WW8_CP nLen, ManTypes nType );
 
 void ImportTox( int nFldId, const OUString aStr );
 
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 5fae570..93583c4 100644

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

2015-08-12 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/hang-3.doc |binary
 sw/source/filter/ww8/ww8par.cxx |4 ++--
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit df28da238abec9af5e41539a876dd1856c7e4523
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Aug 11 20:58:22 2015 +0100

avoid another hang with certain .docs

(cherry picked from commit 0592da19b625975886d3442477f4399660736a69)

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

diff --git a/sw/qa/core/data/ww8/pass/hang-3.doc 
b/sw/qa/core/data/ww8/pass/hang-3.doc
new file mode 100644
index 000..4188b80
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-3.doc differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0215253..1c42ce0 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2288,7 +2288,7 @@ void SwWW8ImplReader::Read_HdFtText(WW8_CP nStart, WW8_CP 
nLen, SwFrmFmt* pHdFtF
 bool SwWW8ImplReader::isValid_HdFt_CP(WW8_CP nHeaderCP) const
 {
 // Each CP of Plcfhdd MUST be less than FibRgLw97.ccpHdd
-return (nHeaderCP  pWwFib-ccpHdr);
+return (nHeaderCP  pWwFib-ccpHdr  nHeaderCP = 0);
 }
 
 bool SwWW8ImplReader::HasOwnHeaderFooter(sal_uInt8 nWhichItems, sal_uInt8 
grpfIhdt,
@@ -2306,7 +2306,7 @@ bool SwWW8ImplReader::HasOwnHeaderFooter(sal_uInt8 
nWhichItems, sal_uInt8 grpfIh
 {
 bool bOk = true;
 if( bVer67 )
-bOk = ( pHdFt-GetTextPos(grpfIhdt, nI, start, nLen )  
nLen = 2 );
+bOk = ( pHdFt-GetTextPos(grpfIhdt, nI, start, nLen )  
start = 0  nLen = 2 );
 else
 {
 pHdFt-GetTextPosExact( static_cast short (nNumber + 
(nSect+1)*6), start, nLen);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-10 Thread Mark Hung
 sw/qa/extras/ooxmlexport/data/tdf91594.docx   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx  |   17 +++
 writerfilter/source/dmapper/DomainMapper.cxx  |   51 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 --
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |   19 ++--
 writerfilter/source/ooxml/model.xml   |1 
 6 files changed, 55 insertions(+), 39 deletions(-)

New commits:
commit 53e86198f2a40f40f291fb6a9cf5cc67e45df94c
Author: Mark Hung mark...@gmail.com
Date:   Wed Jun 24 01:40:13 2015 +0800

tdf#91594 misinterprets letters from Symbol font in docx files

Fix the issue caused by wrong assumption about symbol chracter
and symbol font attributes order in writerfilter. Also allow
symbols to be displayed if user's language is not Western.

Reviewed-on: https://gerrit.libreoffice.org/16543
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Michael Stahl mst...@redhat.com

Conflicts:
writerfilter/source/dmapper/DomainMapper.cxx

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf91594.docx 
b/sw/qa/extras/ooxmlexport/data/tdf91594.docx
new file mode 100644
index 000..ea539af
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf91594.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 2e4b8a3..2d265e2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -661,6 +661,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf89890, tdf89890.docx)
 CPPUNIT_ASSERT(bFound);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf91594, tdf91594.docx)
+{
+uno::Referencetext::XTextRange xPara1(getParagraph(1));
+CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf0fb), xPara1-getString()[0] );
+uno::Referencetext::XTextRange xPara2(getParagraph(2));
+CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf0fc), xPara2-getString()[0] );
+uno::Referencetext::XTextRange xPara3(getParagraph(3));
+CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf0fd), xPara3-getString()[0] );
+uno::Referencetext::XTextRange xPara4(getParagraph(4));
+CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf0fe), xPara4-getString()[0] );
+
+uno::Referencebeans::XPropertySet xRun(getRun(xPara1,1), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString(Wingdings), getPropertyOUString(xRun, 
CharFontName));
+CPPUNIT_ASSERT_EQUAL(OUString(Wingdings), getPropertyOUString(xRun, 
CharFontNameAsian));
+CPPUNIT_ASSERT_EQUAL(OUString(Wingdings), getPropertyOUString(xRun, 
CharFontNameComplex));
+}
+
 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 8dc4ef2..b0c6724 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -239,37 +239,10 @@ void DomainMapper::lcl_attribute(Id nName, Value  val)
 break;
 
 case NS_ooxml::LN_CT_Sym_char:
-if( m_pImpl-GetTopContext()  
m_pImpl-GetTopContext()-GetFootnote().is())
-{
-m_pImpl-GetTopContext()-GetFootnote()-setLabel(OUString( 
sal_Unicode(nIntValue)));
-break;
-}
-else //it's a _real_ symbol
-{
-m_pImpl-SetSymbolData(nIntValue);
-}
+m_pImpl-SetSymbolChar(nIntValue);
 break;
 case NS_ooxml::LN_CT_Sym_font:
-//the footnote symbol and font are provided after the footnote is 
already inserted
-if( m_pImpl-GetTopContext()  
m_pImpl-GetTopContext()-GetFootnote().is())
-{
-uno::Reference beans::XPropertySet  xAnchorProps( 
m_pImpl-GetTopContext()-GetFootnote()-getAnchor(), uno::UNO_QUERY );
-xAnchorProps-setPropertyValue(
-PropertyNameSupplier::GetPropertyNameSupplier().GetName( 
PROP_CHAR_FONT_NAME),
-uno::makeAny( sStringValue ));
-}
-else //a real symbol
-if (m_pImpl-GetTopContext())
-{
-m_pImpl-GetTopContext()-Insert(PROP_CHAR_FONT_NAME, 
uno::makeAny( sStringValue ));
-/*
- * In case of symbol, symbol character get imported first and 
then font of symbols.
- * So we are storing symbol character and when we parse symbol 
font then create UNO object for text.
- */
-sal_Int32 symboldata = m_pImpl-GetSymbolData();
-utext( reinterpret_cast  const sal_uInt8 * ( (symboldata) 
), 1 );
-}
-
+m_pImpl-SetSymbolFont(sStringValue);
 break;
 case NS_ooxml::LN_CT_Underline_val:
 

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

2015-08-10 Thread Michael Stahl
 sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx |binary
 sw/source/core/doc/DocumentLayoutManager.cxx |9 -
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 0ecc9fe7ac1358d9bbcfcebcc348906cca73872b
Author: Michael Stahl mst...@redhat.com
Date:   Fri Aug 7 20:44:43 2015 +0200

sw: fix ~SwIndexReg() assertion on import of tdf92157-1.docx

Problem is that the TextBox SwFrmFmt of a draw object gets a FLY_AS_CHAR
anchor set, which is then not updated later before nodes are deleted.

(regression from c7307c77254557646f33017af915f6808a861e29)

(cherry picked from commit 9dbb88fc41e7a91c852795f00a663c0d073dd70a)

Change-Id: I906ee47b5c30944a08fd8a0d7d6ea8b8c9e6a6a8
Reviewed-on: https://gerrit.libreoffice.org/17581
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/tdf92157-1-minimized.docx 
b/sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx
new file mode 100644
index 000..6edbe18
Binary files /dev/null and 
b/sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx differ
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx 
b/sw/source/core/doc/DocumentLayoutManager.cxx
index 450fac1..08b8fa2 100644
--- a/sw/source/core/doc/DocumentLayoutManager.cxx
+++ b/sw/source/core/doc/DocumentLayoutManager.cxx
@@ -496,7 +496,14 @@ SwFrmFmt *DocumentLayoutManager::CopyLayoutFmt(
 // If the draw format has a TextBox, then copy its fly format as well.
 if (SwFrmFmt* pSourceTextBox = SwTextBoxHelper::findTextBox(rSource))
 {
-SwFrmFmt* pDestTextBox = CopyLayoutFmt(*pSourceTextBox, rNewAnchor, 
bSetTxtFlyAtt, bMakeFrms);
+SwFmtAnchor boxAnchor(rNewAnchor);
+if (FLY_AS_CHAR == boxAnchor.GetAnchorId())
+{
+// AS_CHAR *must not* be set on textbox fly-frame
+boxAnchor.SetType(FLY_AT_CHAR);
+}
+SwFrmFmt* pDestTextBox = CopyLayoutFmt(*pSourceTextBox,
+boxAnchor, bSetTxtFlyAtt, bMakeFrms);
 SwAttrSet aSet(pDest-GetAttrSet());
 SwFmtCntnt 
aCntnt(pDestTextBox-GetCntnt().GetCntntIdx()-GetNode().GetStartNode());
 aSet.Put(aCntnt);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-28 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/tdf89702.docx   |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   14 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   16 ++--
 3 files changed, 24 insertions(+), 6 deletions(-)

New commits:
commit 3370c2caa28577a80f81efb954a227c58531c6ee
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Jul 21 09:04:44 2015 +0200

tdf#89702 DOCX import: fix too large bullet character

Commit c1f8437dbed0e8b989e41a345ef7e658a6e8a4cd (fdo#83465 RTF import:
handle font of numbering, 2014-09-25), changed the get the me character
style of the current numbering's current level member function to be
successfull even in case we're inside a DOCX run, not when we're inside
a DOCX paragraph, but outside runs.

While this is necessary for RTF, the side effect of this was that
unwanted run properties started to affect the above mentioned character
style in case of DOCX.

Fix the problem by enabling the in paragraph and run looking for RTF
only.

Change-Id: I610bfce6cec15b918fe547402360f5a894401f7e
(cherry picked from commit fc7c1a07d0d5e21a4e1533a0e5b0ac256763f973)
Reviewed-on: https://gerrit.libreoffice.org/17380
Reviewed-by: Jan Holesovsky ke...@collabora.com
Tested-by: Jan Holesovsky ke...@collabora.com

diff --git a/sw/qa/extras/ooxmlimport/data/tdf89702.docx 
b/sw/qa/extras/ooxmlimport/data/tdf89702.docx
new file mode 100644
index 000..5542d1c
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf89702.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 1f5843d..ced25ac 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2609,6 +2609,20 @@ DECLARE_OOXMLIMPORT_TEST(testTdf90611, tdf90611.docx)
 CPPUNIT_ASSERT_EQUAL(10.f, getPropertyfloat(getParagraphOfText(1, 
xFootnoteText), CharHeight));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf89702, tdf89702.docx)
+{
+// Get the first paragraph's numbering style's 2nd level's character style 
name.
+uno::Referencetext::XTextRange xParagraph = getParagraph(1);
+auto xLevels = getProperty uno::Referencecontainer::XIndexAccess 
(xParagraph, NumberingRules);
+uno::Sequencebeans::PropertyValue aLevel;
+xLevels-getByIndex(1) = aLevel; // 2nd level
+OUString aCharStyleName = std::find_if(aLevel.begin(), aLevel.end(), 
[](const beans::PropertyValue rValue) { return rValue.Name == CharStyleName; 
})-Value.getOUString();
+
+// Make sure that the font name is Arial, this was Verdana.
+uno::Referencebeans::XPropertySet 
xStyle(getStyles(CharacterStyles)-getByName(aCharStyleName), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString(Arial), getPropertyOUString(xStyle, 
CharFontName));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 66453ac..f6874f5 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4942,12 +4942,16 @@ uno::Referencebeans::XPropertySet 
DomainMapper_Impl::GetCurrentNumberingCharSt
 uno::Referencecontainer::XIndexAccess xLevels = 
GetCurrentNumberingRules(nListLevel);
 if (!xLevels.is())
 {
-// Looking up the paragraph context explicitly (and not just taking
-// the top context) is necessary for RTF, where formatting of a run
-// and of the paragraph mark is not separated.
-PropertyMapPtr pContext = GetTopContextOfType(CONTEXT_PARAGRAPH);
-if (!pContext)
-return xRet;
+PropertyMapPtr pContext = m_pTopContext;
+if (IsRTFImport())
+{
+// Looking up the paragraph context explicitly (and not just 
taking
+// the top context) is necessary for RTF, where formatting of 
a run
+// and of the paragraph mark is not separated.
+pContext = GetTopContextOfType(CONTEXT_PARAGRAPH);
+if (!pContext)
+return xRet;
+}
 
 // In case numbering rules is not found via a style, try the 
direct formatting instead.
 boost::optionalPropertyMap::Property oProp = 
pContext-getProperty(PROP_NUMBERING_RULES);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-24 Thread Michael Stahl
 sw/qa/extras/rtfimport/data/tdf90046.rtf   |8 
 sw/qa/extras/rtfimport/rtfimport.cxx   |9 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |1 +
 3 files changed, 18 insertions(+)

New commits:
commit c6f8e34c713c205fa9d2e10f5560eff37ad95a34
Author: Michael Stahl mst...@redhat.com
Date:   Fri Jul 24 14:40:53 2015 +0200

tdf#90046: RTF import: ensure that a run is started before \footnote

Avoids crashing with empty context stacks.

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

diff --git a/sw/qa/extras/rtfimport/data/tdf90046.rtf 
b/sw/qa/extras/rtfimport/data/tdf90046.rtf
new file mode 100644
index 000..656adb5
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf90046.rtf
@@ -0,0 +1,8 @@
+{\rtf1\ansi\deflang1035
+{\fonttbl {\f0\fcharset0 Arial;} }
+
+\pard\ltrpar\uc1\lang1035
+{\super \chftn
+{\footnote {\pard\plain\super \chftn }{\plain\ltrch\f0 \fs18 \cf1 \uc0\u77 
\u97 }
+}}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index bfff118..bd2e974 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2225,6 +2225,15 @@ DECLARE_RTFIMPORT_TEST(testFdo85889pca, 
fdo85889-pca.rtf)
 CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange-getString());
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf90046, tdf90046.rtf)
+{
+// this was crashing on importing the footnote
+uno::Referencetext::XFootnotesSupplier xFootnotesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xFootnotes(xFootnotesSupplier-getFootnotes(), uno::UNO_QUERY);
+uno::Referencetext::XTextRange xTextRange(xFootnotes-getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString(Ma), xTextRange-getString());
+}
+
 DECLARE_RTFIMPORT_TEST(testFdo85889mac, fdo85889-mac.rtf)
 {
 uno::Referencetext::XTextRange xTextRange = getRun(getParagraph(1), 1);
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index ea5a212..259a19a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1683,6 +1683,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 }
 break;
 case RTF_FOOTNOTE:
+checkFirstRun();
 if (!m_pSuperstream)
 {
 Id nId = NS_ooxml::LN_footnote;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-23 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/crash-1.doc |binary
 sw/source/filter/ww8/ww8par.cxx  |   13 -
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit bd90302b8bea166d8f5af2e949cc701acd804909
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jul 22 13:51:19 2015 +0100

xstUsrInitl contains max 9 chars

(cherry picked from commit cbea6a709f33babfb490ab1bd07cde8cc08114ac)

Change-Id: Ia40d037d7af6cd3a283aa12948e4c5565dcb2ae6
Reviewed-on: https://gerrit.libreoffice.org/17293
Reviewed-by: Michael Meeks michael.me...@collabora.com
Tested-by: Michael Meeks michael.me...@collabora.com

diff --git a/sw/qa/core/data/ww8/pass/crash-1.doc 
b/sw/qa/core/data/ww8/pass/crash-1.doc
new file mode 100644
index 000..9f6b253
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/crash-1.doc differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 9a6131c..7489ca5 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2172,15 +2172,18 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
 if (pA)
 sAuthor = *pA;
 else
-sAuthor = OUString(pDescri-xstUsrInitl + 1, 
pDescri-xstUsrInitl[0],
-RTL_TEXTENCODING_MS_1252);
+{
+const sal_uInt8 nLen = std::minsal_uInt8(pDescri-xstUsrInitl[0],
+   
SAL_N_ELEMENTS(pDescri-xstUsrInitl)-1);
+sAuthor = OUString(pDescri-xstUsrInitl + 1, nLen, 
RTL_TEXTENCODING_MS_1252);
+}
 }
 else
 {
-const WW8_ATRD* pDescri = (const WW8_ATRD*)pSD-GetData();
-
+const WW8_ATRD* pDescri = static_castconst WW8_ATRD*(pSD-GetData());
 {
-const sal_uInt16 nLen = SVBT16ToShort(pDescri-xstUsrInitl[0]);
+const sal_uInt16 nLen = 
std::minsal_uInt16(SVBT16ToShort(pDescri-xstUsrInitl[0]),
+ 
SAL_N_ELEMENTS(pDescri-xstUsrInitl)-1);
 OUStringBuffer aBuf;
 aBuf.setLength(nLen);
 for(sal_uInt16 nIdx = 1; nIdx = nLen; ++nIdx)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-23 Thread Caolán McNamara
 sw/qa/core/data/ww8/pass/hang-1.doc |binary
 sw/source/filter/ww8/ww8par3.cxx|5 ++---
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 7c450576817d2b41d6f0a1f2446d29077ddfc555
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jul 21 17:06:05 2015 +0100

need to check for after reading and before seeking

seeking resets eof, so the IsEof is always false
after the first loop

Change-Id: I2e533f3f9c494566aabb947c05258a770e883b1f
(cherry picked from commit e2e6fa5ad5aaa20a9fa8a6d060d9edd241aefd52)
Reviewed-on: https://gerrit.libreoffice.org/17272
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/core/data/ww8/pass/hang-1.doc 
b/sw/qa/core/data/ww8/pass/hang-1.doc
new file mode 100644
index 000..8d68bbb
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-1.doc differ
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index a21ac05..1e6c84d 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1266,15 +1266,14 @@ WW8ListManager::WW8ListManager(SvStream rSt_, 
SwWW8ImplReader rReader_)
 {
 bOk = false;
 
-if (rSt.IsEof())
-break;
-
 WW8LFO aLFO;
 memset(aLFO, 0, sizeof( aLFO ));
 
 rSt.ReadUInt32( aLFO.nIdLst );
 rSt.SeekRel( 8 );
 rSt.ReadUChar( aLFO.nLfoLvl );
+if (!rSt.good())
+break;
 rSt.SeekRel( 3 );
 // soviele Overrides existieren
 if ((nMaxLevel  aLFO.nLfoLvl) || rSt.GetError())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-09 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/tdf90611.docx   |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   10 ++
 writerfilter/source/dmapper/DomainMapper.cxx  |2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   13 +
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |4 
 5 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit 6178e1e784b8a7881395972b9e6f0222c012a9b1
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jul 6 09:23:40 2015 +0200

tdf#90611 DOCX import: fix missing paragraph style on footnotes

One one hand, a problem since commit
330b860205c7ba69dd6603f65324d0f89ad9cd5f (fdo#68787 DOCX import: handle
when w:separator is missing for footnotes, 2013-09-04) was that the type
attribute from w:footnote w:type=separator resulted in two
ooxml:CT_FtnEdn_type tokens, ignoring too many paragraph ends for
footnotes, which resulted in missing paragraph style on footnotes.

On the other hand, fixing the first problem showed that it wasn't
correct that commit 9389cf78e304a5a99bcf1745b9388e14ac36281a (cp#118
RTF import: empty para at the end of footnote text got lost, 2013-11-15)
unconditionally removed the RemoveLastParagraph() call in
DomainMapper_Impl::PopFootOrEndnote(). It turns out that RTF and DOCX
have different semantics here, the footnote is always within a p/p
pair in DOCX, while in RTF a \par at the end of a
footnote means an empty paragraph. Fix that by conditionally restoring
the removed RemoveLastParagraph() call.

(cherry picked from commit 519b34300f73b1e08f6194d6ba49d4fc010cf186)

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

diff --git a/sw/qa/extras/ooxmlimport/data/tdf90611.docx 
b/sw/qa/extras/ooxmlimport/data/tdf90611.docx
new file mode 100644
index 000..ac54fee
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf90611.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index beab2d1..1f5843d 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2599,6 +2599,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf87460, tdf87460.docx)
 CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(1), xEndnotes-getCount());
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf90611, tdf90611.docx)
+{
+uno::Referencetext::XFootnotesSupplier xFootnotesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xFootnotes(xFootnotesSupplier-getFootnotes(), uno::UNO_QUERY);
+uno::Referencetext::XText xFootnoteText;
+xFootnotes-getByIndex(0) = xFootnoteText;
+// This was 11.
+CPPUNIT_ASSERT_EQUAL(10.f, getPropertyfloat(getParagraphOfText(1, 
xFootnoteText), CharHeight));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 612b208..8dc4ef2 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -975,7 +975,7 @@ void DomainMapper::lcl_attribute(Id nName, Value  val)
 case NS_ooxml::LN_CT_FtnEdn_type:
 // This is the separator footnote, ignore its linebreak.
 if (static_castsal_uInt32(nIntValue) == 
NS_ooxml::LN_Value_doc_ST_FtnEdn_separator)
-m_pImpl-m_bIgnoreNextPara = true;
+m_pImpl-SeenFootOrEndnoteSeparator();
 break;
 case NS_ooxml::LN_CT_DataBinding_prefixMappings:
 m_pImpl-appendGrabBag(m_pImpl-m_aInteropGrabBag, 
ooxml:CT_DataBinding_prefixMappings, sStringValue);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f043ba1..66453ac 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -185,6 +185,7 @@ DomainMapper_Impl::DomainMapper_Impl(
 m_bInHeaderFooterImport( false ),
 m_bDiscardHeaderFooter( false ),
 m_bInFootOrEndnote(false),
+m_bSeenFootOrEndnoteSeparator(false),
 m_bLineNumberingSet( false ),
 m_bIsInFootnoteProperties( false ),
 m_bIsCustomFtnMark( false ),
@@ -1712,6 +1713,9 @@ void DomainMapper_Impl::PushAnnotation()
 
 void DomainMapper_Impl::PopFootOrEndnote()
 {
+if (!IsRTFImport())
+RemoveLastParagraph();
+
 // In case the foot or endnote did not contain a tab.
 m_bIgnoreNextTab = false;
 
@@ -1724,9 +1728,18 @@ void DomainMapper_Impl::PopFootOrEndnote()
 return;
 }
 m_aRedlines.pop();
+m_bSeenFootOrEndnoteSeparator = false;
 m_bInFootOrEndnote = false;
 }
 
+void DomainMapper_Impl::SeenFootOrEndnoteSeparator()
+{
+if 

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

2015-07-08 Thread Miklos Vajna
 sw/qa/extras/ooxmlexport/data/tdf89890.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |   23 +++
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx|2 +-
 writerfilter/source/dmapper/NumberingManager.cxx |   14 ++
 4 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit e3d78d605905ef23b15002a29f0f3a6de5cc12ac
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Jun 26 09:02:31 2015 +0200

tdf#89890 DOCX import: fix too large num pic bullet

Reading SwWW8ImplReader::CoreLoad()'s update graphic bullet
information block, it turns out that the numbering picture bullet's
height should be independent from the supplied bitmap, and only its
aspect ratio should be respected.

Reviewed-on: https://gerrit.libreoffice.org/16500
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Jenkins c...@libreoffice.org
(cherry picked from commit eab89b7f024a8c86decdcb3362c40c40a7df37df)

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

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf89890.docx 
b/sw/qa/extras/ooxmlexport/data/tdf89890.docx
new file mode 100644
index 000..8b3e8eb
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf89890.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index ac4b246..2e4b8a3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -638,6 +638,29 @@ DECLARE_OOXMLEXPORT_TEST(testTdf91261, tdf91261.docx)
 
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf89890, tdf89890.docx)
+{
+// Numbering picture bullet was too large.
+uno::Referencebeans::XPropertySet 
xPropertySet(getStyles(NumberingStyles)-getByName(WWNum1), uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xLevels(xPropertySet-getPropertyValue(NumberingRules), uno::UNO_QUERY);
+uno::Sequencebeans::PropertyValue aProps;
+xLevels-getByIndex(0) = aProps; // 1st level
+
+bool bFound = false;
+for (int i = 0; i  aProps.getLength(); ++i)
+{
+const beans::PropertyValue rProp = aProps[i];
+
+if (rProp.Name == GraphicSize)
+{
+// Height of the graphic was too large: 4382 after import, then 
2485 after roundtrip.
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(279), 
rProp.Value.getawt::Size().Height);
+bFound = true;
+}
+}
+CPPUNIT_ASSERT(bFound);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index e187959..9a495fd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -353,7 +353,7 @@ DECLARE_OOXMLEXPORT_TEST(testFDO74215, FDO74215.docx)
 xmlDocPtr pXmlDoc = parseExport(word/numbering.xml);
 if (!pXmlDoc)
 return;
-assertXPath(pXmlDoc, /w:numbering/w:numPicBullet[2]/w:pict/v:shape, 
style, width:6.4pt;height:6.4pt);
+assertXPath(pXmlDoc, /w:numbering/w:numPicBullet[2]/w:pict/v:shape, 
style, width:7.9pt;height:7.9pt);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testColumnBreak_ColumnCountIsZero,fdo74153.docx)
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 2412f8c..17786ea 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -877,6 +877,20 @@ void ListsManager::lcl_sprm( Sprm rSprm )
 case NS_ooxml::LN_CT_NumPicBullet_pict:
 {
 uno::Referencedrawing::XShape xShape = 
m_rDMapper.PopPendingShape();
+
+// Respect only the aspect ratio of the picture, not its size.
+awt::Size aPrefSize = xShape-getSize();
+// See SwDefBulletConfig::InitFont(), default height is 14.
+const int nFontHeight = 14;
+// Point - mm100.
+const int nHeight = nFontHeight * 35;
+if (aPrefSize.Height * aPrefSize.Width != 0)
+{
+int nWidth = (nHeight * aPrefSize.Width) / 
aPrefSize.Height;
+awt::Size aSize(nWidth, nHeight);
+xShape-setSize(aSize);
+}
+
 m_pCurrentNumPicBullet-SetShape(xShape);
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-07 Thread Mark Hung
 sw/qa/extras/ww8export/data/tdf92281.doc |binary
 sw/qa/extras/ww8export/ww8export.cxx |8 
 sw/source/filter/ww8/ww8par6.cxx |2 ++
 3 files changed, 10 insertions(+)

New commits:
commit ef8615158921edaf5f3f6ee61425c25499b3a3d2
Author: Mark Hung mark...@gmail.com
Date:   Mon Jun 29 21:59:23 2015 +0800

tdf#92281 - FILEOPEN: Only western font is set for symbols in DOC files

Inserting a symbol in Writer set all fonts including CJK and CTL
to the same one. This patch makes the behavior consistent with that,
allows CJK and CTL user to see the symbols.

Reviewed-on: https://gerrit.libreoffice.org/16604
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk

Conflicts:
sw/source/filter/ww8/ww8par6.cxx

Change-Id: I7a61868e8078c81c68e471760f080b3ce7df589f
Reviewed-on: https://gerrit.libreoffice.org/16820
Reviewed-by: Christian Lohmaier lohmaier+libreoff...@googlemail.com
Tested-by: Christian Lohmaier lohmaier+libreoff...@googlemail.com

diff --git a/sw/qa/extras/ww8export/data/tdf92281.doc 
b/sw/qa/extras/ww8export/data/tdf92281.doc
new file mode 100644
index 000..2893eb3
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf92281.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx 
b/sw/qa/extras/ww8export/ww8export.cxx
index e03c3cc..81ca031 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -440,6 +440,14 @@ DECLARE_WW8EXPORT_TEST(testWw8Cjklist35, cjklist35.doc)
 CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_LOWER_ZH, numFormat);
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf92281, tdf92281.doc)
+{
+uno::Referencebeans::XPropertySet xRun(getRun(getParagraph(1),1), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString(Wingdings), 
getPropertyOUString(xRun, CharFontName));
+CPPUNIT_ASSERT_EQUAL(OUString(Wingdings), 
getPropertyOUString(xRun, CharFontNameAsian));
+CPPUNIT_ASSERT_EQUAL(OUString(Wingdings), 
getPropertyOUString(xRun, CharFontNameComplex));
+}
+
 DECLARE_WW8EXPORT_TEST(testCommentedTable, commented-table.doc)
 {
 // Document has a non-trivial commented text range, as the range contains 
a table.
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 758c292..e0261c5 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2758,6 +2758,8 @@ void SwWW8ImplReader::Read_Symbol(sal_uInt16, const 
sal_uInt8* pData, short nLen
 //themselves so they don't need to add it to the stack either.
 if (SetNewFontAttr(SVBT16ToShort( pData ), false, RES_CHRATR_FONT))
 {
+SetNewFontAttr(SVBT16ToShort( pData ), false, 
RES_CHRATR_CJK_FONT);
+SetNewFontAttr(SVBT16ToShort( pData ), false, 
RES_CHRATR_CTL_FONT);
 if( bVer67 )
 {
 //convert single byte from MS1252 to Unicode
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-07 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |4 ++--
 writerfilter/source/dmapper/GraphicImport.cxx |8 
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 8b7ec09054f3186ec9d6cb49a1314143cb89da78
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jun 24 09:08:56 2015 +0200

tdf#89698 DOCX import: inline picture should have no spacing

Commit 3d7e168a2a43c2414b0633379102ddb29437e75b (n#783638 DOCX import of
wp:inline's distT/B/L/R attributes, 2012-10-11) was about a picture that
had non-zero spacing in LO, but zero in Word. The hope was that the
problem is just that the value is not imported.

Then commit a88ac708403c03d0f950f09ec29c0d5a1e5a85b4 (fdo#63685
wp:inline's distT/B/L/R is in EMU's, not twips, 2013-04-19) was about a
picture that had so large spacing that the picture become invisible.
Fixing the unit of the spacing value made the picture visible again.

What was missed is that this value is just stored in the doc model, but
layout in Word doesn't use it at all till the anchoring is as-char.
Given that in LO as-char anchoring supports real spacing, just don't
import these values to have the same layout. That's what the WW8 import
does, too.

(cherry picked from commit 9781a8786da5c32e2250cbe1ae97bd10f84f39bb)

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

diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 99417ce..beab2d1 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1267,8 +1267,8 @@ DECLARE_OOXMLIMPORT_TEST(testConditionalstylesTbllook, 
conditionalstyles-tblloo
 
 DECLARE_OOXMLIMPORT_TEST(testFdo63685, fdo63685.docx)
 {
-// Was 85697, i.e. original 114120 was converted to mm100 from twips, not 
from EMUs.
-CPPUNIT_ASSERT_EQUAL(sal_Int32(318), getPropertysal_Int32(getShape(1), 
TopMargin));
+// An inline image's wrapping should be always zero, even if the doc model 
has a non-zero value.
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getPropertysal_Int32(getShape(1), 
TopMargin));
 }
 
 DECLARE_OOXMLIMPORT_TEST(testN592908_Frame, n592908-frame.docx)
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx 
b/writerfilter/source/dmapper/GraphicImport.cxx
index 5851799..e2a2372 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -858,16 +858,16 @@ void GraphicImport::lcl_attribute(Id nName, Value rValue)
 }
 break;
 case NS_ooxml::LN_CT_Inline_distT:
-m_pImpl-nTopMargin = oox::drawingml::convertEmuToHmm(nIntValue);
+m_pImpl-nTopMargin = 0;
 break;
 case NS_ooxml::LN_CT_Inline_distB:
-m_pImpl-nBottomMargin = 
oox::drawingml::convertEmuToHmm(nIntValue);
+m_pImpl-nBottomMargin = 0;
 break;
 case NS_ooxml::LN_CT_Inline_distL:
-m_pImpl-nLeftMargin = oox::drawingml::convertEmuToHmm(nIntValue);
+m_pImpl-nLeftMargin = 0;
 break;
 case NS_ooxml::LN_CT_Inline_distR:
-m_pImpl-nRightMargin = oox::drawingml::convertEmuToHmm(nIntValue);
+m_pImpl-nRightMargin = 0;
 break;
 case NS_ooxml::LN_CT_GraphicalObjectData_uri:
 rValue.getString();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-03 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/tdf87460.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |9 +
 writerfilter/CppunitTest_writerfilter_misc.mk|1 +
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   12 ++--
 writerfilter/source/dmapper/DomainMapperTableHandler.hxx |4 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|8 
 writerfilter/source/dmapper/DomainMapper_Impl.hxx|3 ++-
 7 files changed, 34 insertions(+), 3 deletions(-)

New commits:
commit b21ed9a42321dd4b22b70bfc66b7d401f2d22cd4
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Jun 23 09:03:10 2015 +0200

tdf#87460 DOCX import: fix missing endnote in floattable

Writer doesn't support foot or endnotes in TextFrames, so they are not
supported in OOXML floattables, either. In the past, floattables were
imported as normal tables, that's how this worked. Restore the old
situation till the core limitation is there, so we at least don't
regress.

(cherry picked from commit 2fe248f2b36d541c0d243a620c217058a50a9d5d)

Conflicts:
writerfilter/source/dmapper/DomainMapperTableHandler.hxx
writerfilter/source/dmapper/DomainMapper_Impl.hxx

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

diff --git a/sw/qa/extras/ooxmlimport/data/tdf87460.docx 
b/sw/qa/extras/ooxmlimport/data/tdf87460.docx
new file mode 100644
index 000..c443dbe
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf87460.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 4a7a8bc..99417ce 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2590,6 +2590,15 @@ DECLARE_OOXMLIMPORT_TEST(testTdf8255, tdf8255.docx)
 CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(0), xDrawPage-getCount());
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf87460, tdf87460.docx)
+{
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencetext::XEndnotesSupplier xEndnotesSupplier(xTextDocument, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess xEndnotes = 
xEndnotesSupplier-getEndnotes();
+// This was 0: endnote was lost on import.
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(1), xEndnotes-getCount());
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/CppunitTest_writerfilter_misc.mk 
b/writerfilter/CppunitTest_writerfilter_misc.mk
index 3f4fd80..f563c7a 100644
--- a/writerfilter/CppunitTest_writerfilter_misc.mk
+++ b/writerfilter/CppunitTest_writerfilter_misc.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_CppunitTest_set_include,writerfilter_misc,\
 $$(INCLUDE) \
 -I$(SRCDIR)/writerfilter/inc \
 -I$(SRCDIR)/writerfilter/source \
+-I$(SRCDIR)/writerfilter/source/dmapper \
 ))
 
 $(eval $(call gb_CppunitTest_use_external,writerfilter_misc,boost_headers))
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index c1487b4..468b38a 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -55,7 +55,8 @@ 
DomainMapperTableHandler::DomainMapperTableHandler(TextReference_t const xText,
 : m_xText(xText),
 m_rDMapper_Impl( rDMapper_Impl ),
 m_nCellIndex(0),
-m_nRowIndex(0)
+m_nRowIndex(0),
+m_bHadFootOrEndnote(false)
 {
 }
 
@@ -1078,7 +1079,8 @@ void DomainMapperTableHandler::endTable(unsigned int 
nestedTableLevel)
 }
 
 // If we have a table with a start and an end position, we should make 
it a floating one.
-if (xTable.is()  xStart.is()  xEnd.is())
+// Unless the table had a foot or endnote, as Writer doesn't support 
those in TextFrames.
+if (xTable.is()  xStart.is()  xEnd.is()  !m_bHadFootOrEndnote)
 {
 uno::Referencebeans::XPropertySet xTableProperties(xTable, 
uno::UNO_QUERY);
 bool bIsRelative = false;
@@ -1123,6 +1125,7 @@ void DomainMapperTableHandler::endTable(unsigned int 
nestedTableLevel)
 m_aTableProperties.reset();
 m_aCellProperties.clear();
 m_aRowProperties.clear();
+m_bHadFootOrEndnote = false;
 
 #ifdef DEBUG_WRITERFILTER
 dmapper_logger-endElement();
@@ -1203,6 +1206,11 @@ void DomainMapperTableHandler::endCell(const Handle_t  
end)
 ++m_nCellIndex;
 }
 
+void DomainMapperTableHandler::setHadFootOrEndnote(bool bHadFootOrEndnote)
+{
+m_bHadFootOrEndnote = bHadFootOrEndnote;
+}
+
 }}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx 

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

2015-06-30 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/tdf92061.rtf   |5 +
 sw/qa/extras/rtfimport/rtfimport.cxx   |6 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 ++
 3 files changed, 13 insertions(+)

New commits:
commit 326ca9e0710d17274eb0a6cdc0d95d4f933784f0
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jun 22 09:05:30 2015 +0200

tdf#92061 RTF import: fix missing body text after footnote

A missing seek in the \footnote handler could result in a situation that
the missed text contained a { but not its matching }, which resulted
in the parser terminating earlier than the end of the document.

(cherry picked from commit 7b08304b55cf2284a3c583426c60baef618ba206)

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

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

diff --git a/sw/qa/extras/rtfimport/data/tdf92061.rtf 
b/sw/qa/extras/rtfimport/data/tdf92061.rtf
new file mode 100644
index 000..03978b4
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf92061.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+body-before
+{\footnote A {B} C}
+body-after\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index f7fa4de..bfff118 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2309,6 +2309,12 @@ DECLARE_RTFIMPORT_TEST(testTdf90315, tdf90315.rtf)
 CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(1270), 
getPropertysal_Int32(xTextSection-getPropertyValue(TextColumns), 
AutomaticDistance));
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf92061, tdf92061.rtf)
+{
+// This was C, i.e. part of the footnote ended up in the body text.
+CPPUNIT_ASSERT_EQUAL(OUString(body-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 75978e4..ea5a212 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1690,11 +1690,13 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 // Check if this is an endnote.
 OStringBuffer aBuf;
 char ch;
+sal_Size nCurrent = Strm().Tell();
 for (int i = 0; i  7; ++i)
 {
 Strm().ReadChar(ch);
 aBuf.append(ch);
 }
+Strm().Seek(nCurrent);
 OString aKeyword = aBuf.makeStringAndClear();
 if (aKeyword.equals(\\ftnalt))
 nId = NS_ooxml::LN_endnote;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-06-23 Thread Michael Stahl
 sw/qa/extras/odfexport/data/redlineTextFrame.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx |9 +
 sw/source/core/txtnode/atrflyin.cxx  |   22 ++--
 sw/source/core/txtnode/thints.cxx|   40 ++-
 4 files changed, 32 insertions(+), 39 deletions(-)

New commits:
commit 2f874b1030d1062c446993af272d99eafdf674e7
Author: Michael Stahl mst...@redhat.com
Date:   Fri Jun 12 17:04:45 2015 +0200

tdf#91228: need to check the format's IsLockModified(), not the node's

commit 9f01951b858453684f2622541af0eb85d4544fc6 also did the extra
Remove/Add for Draw fly objects, and it turns out that that's actually
wrong because SwTextFlyCnt::SetAnchor() will set the anchor without
locking anything if it's a Draw object.  Replace it with a different
hack in SetAnchor() that applies only if it calls LockModify().

Thanks to Varun Dhall for creating a reproducer document.

Not sure if the LockModify() could be replaced completely, perhaps it's
just an optimization to avoid re-creating layout frames for the fly.

(cherry picked from commit fae87e03ea3829718ec0381ed3b04ceb52c23720)

Conflicts:
sw/source/core/txtnode/atrflyin.cxx
sw/source/core/txtnode/thints.cxx

Added test for redline with as-char frame

fixed by commits 4dd2e61 and fae87e0

Reviewed-by: Michael Stahl mst...@redhat.com
(cherry picked from commit f36ac1aa3bef5ba218f3dae24f260ce7e4afba95)

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

diff --git a/sw/qa/extras/odfexport/data/redlineTextFrame.odt 
b/sw/qa/extras/odfexport/data/redlineTextFrame.odt
new file mode 100644
index 000..0986c37
Binary files /dev/null and b/sw/qa/extras/odfexport/data/redlineTextFrame.odt 
differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index df5da9c..a7c1a18 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -37,6 +37,15 @@ public:
 
 #define DECLARE_ODFEXPORT_TEST(TestName, filename) 
DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test)
 
+DECLARE_ODFEXPORT_TEST(testredlineTextFrame, redlineTextFrame.odt)
+{
+//Note this is for a crash test
+//Counting the Number of Frames and checking with the expected count
+uno::Referencetext::XTextFramesSupplier xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xIndexAccess(xTextFramesSupplier-getTextFrames(), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess-getCount());
+}
+
 DECLARE_ODFEXPORT_TEST(testFdo38244, fdo38244.odt)
 {
 // See ooxmlexport's testFdo38244().
diff --git a/sw/source/core/txtnode/atrflyin.cxx 
b/sw/source/core/txtnode/atrflyin.cxx
index 7dc780e..08acb35 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -151,12 +151,19 @@ void SwTxtFlyCnt::SetAnchor( const SwTxtNode *pNode )
 SwFrmFmt* pFmt = GetFlyCnt().GetFrmFmt();
 SwFmtAnchor aAnchor( pFmt-GetAnchor() );
 
-if( !aAnchor.GetCntntAnchor() ||
-!aAnchor.GetCntntAnchor()-nNode.GetNode().GetNodes().IsDocNodes() ||
-aAnchor.GetCntntAnchor()-nNode.GetNode() != (SwNode*)pNode )
+SwNode *const pOldNode(aAnchor.GetCntntAnchor()
+? aAnchor.GetCntntAnchor()-nNode.GetNode()
+: nullptr);
+
+if (!pOldNode || !pOldNode-GetNodes().IsDocNodes() ||
+pOldNode != static_castSwNode const *(pNode))
+{
 aPos.nNode = *pNode;
+}
 else
-aPos.nNode = aAnchor.GetCntntAnchor()-nNode;
+{
+aPos.nNode = *pOldNode;
+}
 
 aAnchor.SetType( FLY_AS_CHAR );// default!
 aAnchor.SetAnchor( aPos );
@@ -186,10 +193,17 @@ void SwTxtFlyCnt::SetAnchor( const SwTxtNode *pNode )
 {
 pFmt-LockModify();
 pFmt-SetFmtAttr( aAnchor );// nur den Anker neu setzen
+// tdf#91228 must notify the anchor nodes despite LockModify
+assert(pOldNode);
+pOldNode-RemoveAnchoredFly(pFmt);
+aPos.nNode.GetNode().AddAnchoredFly(pFmt);
 pFmt-UnlockModify();
 }
 else
+{
+assert(!pFmt-IsModifyLocked()); // need to notify anchor node
 pFmt-SetFmtAttr( aAnchor );// nur den Anker neu setzen
+}
 
 // Am Node haengen u.a. abhaengige CntFrms.
 // Fuer jeden CntFrm wird ein SwFlyInCntFrm angelegt.
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 37b0c26..a03b391a7 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1277,44 +1277,19 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, 
const SetAttrMode nMode )
 {
 SwTxtFlyCnt *pFly = 

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

2015-06-16 Thread Miklos Vajna
 sw/qa/extras/ooxmlimport/data/tdf8255.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx|9 +
 writerfilter/source/dmapper/PropertyMap.cxx |   12 +++-
 3 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 853033da3710f0e8df1b5d0d5355c6b0ce1c9ea0
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jun 8 07:48:42 2015 +0200

tdf#82553 DOCX import: handle table margin when converting floattables

(cherry picked from commit 292ec5fe8d01af6119325f1a426422bb42e58615)

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

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

diff --git a/sw/qa/extras/ooxmlimport/data/tdf8255.docx 
b/sw/qa/extras/ooxmlimport/data/tdf8255.docx
new file mode 100644
index 000..366e498
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf8255.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 0721a1e..4a7a8bc 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2581,6 +2581,15 @@ DECLARE_OOXMLIMPORT_TEST(testFdo87488, fdo87488.docx)
 }
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf8255, tdf8255.docx)
+{
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencedrawing::XDrawPageSupplier 
xDrawPageSupplier(xTextDocument, uno::UNO_QUERY);
+uno::Referencedrawing::XDrawPage xDrawPage = 
xDrawPageSupplier-getDrawPage();
+// This was 1: a full-page-wide multi-page floating table was imported as 
a TextFrame.
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(0), xDrawPage-getCount());
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 845dbe6..f83862c 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1037,6 +1037,16 @@ void SectionPropertyMap::CloseSectionGroup( 
DomainMapper_Impl rDM_Impl )
 for (size_t i = 0; i  rPendingFloatingTables.size(); ++i)
 {
 FloatingTableInfo rInfo = rPendingFloatingTables[i];
+
+// Count the layout width of the table.
+sal_Int32 nTableWidth = rInfo.m_nTableWidth;
+sal_Int32 nLeftMargin = 0;
+if (rInfo.getPropertyValue(LeftMargin) = nLeftMargin)
+nTableWidth += nLeftMargin;
+sal_Int32 nRightMargin = 0;
+if (rInfo.getPropertyValue(RightMargin) = nRightMargin)
+nTableWidth += nRightMargin;
+
 // If the table is wider than the text area, then don't create a fly
 // for the table: no wrapping will be performed anyway, but multi-page
 // tables will be broken.
@@ -1045,7 +1055,7 @@ void SectionPropertyMap::CloseSectionGroup( 
DomainMapper_Impl rDM_Impl )
 // If there are columns, always create the fly, otherwise the columns 
would
 // restrict geometry of the table.
 if ( ( rInfo.getPropertyValue(HoriOrientRelation) == 
text::RelOrientation::PAGE_FRAME ) ||
- ( rInfo.m_nTableWidth  nTextAreaWidth ) || ColumnCount() + 1 = 
2 )
+ nTableWidth  nTextAreaWidth || ColumnCount() + 1 = 2 )
 xBodyText-convertToTextFrame(rInfo.m_xStart, rInfo.m_xEnd, 
rInfo.m_aFrameProperties);
 }
 rPendingFloatingTables.clear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-06-11 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/tdf90315.rtf |4 
 sw/qa/extras/rtfimport/rtfimport.cxx |9 +
 writerfilter/source/dmapper/SectionColumnHandler.cxx |2 +-
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 065a4d93287c0c3f16c516004c078fca948e3fc4
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat May 23 19:23:05 2015 +0100

tdf#90315 RTF import: fix \colsx default value

See SectPageInformation::mnColsx on the libreoffice-3-6 branch + the
spec agrees, too.

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

diff --git a/sw/qa/extras/rtfimport/data/tdf90315.rtf 
b/sw/qa/extras/rtfimport/data/tdf90315.rtf
new file mode 100644
index 000..df99754
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf90315.rtf
@@ -0,0 +1,4 @@
+{\rtf1\cols2
+foo\par
+bar\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 66f04e7..f7fa4de 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2300,6 +2300,15 @@ DECLARE_RTFIMPORT_TEST(testTdf86814, tdf86814.rtf)
 CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, 
getPropertyfloat(getRun(getParagraph(1), 1), CharWeight));
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf90315, tdf90315.rtf)
+{
+uno::Referencetext::XTextSectionsSupplier 
xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xTextSections(xTextSectionsSupplier-getTextSections(), uno::UNO_QUERY);
+uno::Referencebeans::XPropertySet 
xTextSection(xTextSections-getByIndex(0), uno::UNO_QUERY);
+// This was 0, but default should be 720 twips.
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(1270), 
getPropertysal_Int32(xTextSection-getPropertyValue(TextColumns), 
AutomaticDistance));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/SectionColumnHandler.cxx 
b/writerfilter/source/dmapper/SectionColumnHandler.cxx
index dbc5ac9..c5d971d 100644
--- a/writerfilter/source/dmapper/SectionColumnHandler.cxx
+++ b/writerfilter/source/dmapper/SectionColumnHandler.cxx
@@ -33,7 +33,7 @@ using namespace ::com::sun::star;
 SectionColumnHandler::SectionColumnHandler()
 : LoggedProperties(dmapper_logger, SectionColumnHandler)
 , bEqualWidth(false)
-, nSpace(0)
+, nSpace(1270) // 720 twips
 , nNum(0)
 , bSep(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-4' - sw/qa sw/source

2015-06-07 Thread Mark Hung
 sw/qa/extras/ooxmlexport/data/outline-num-none.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx   |6 ++
 sw/source/filter/ww8/docxattributeoutput.cxx   |2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 7f605eb84c2b647a87b9bd96ca91c3170b3c84e6
Author: Mark Hung mark...@gmail.com
Date:   Sat Jan 24 06:50:03 2015 -0800

tdf#87574 - Outline numbering None is not retained in docx

Partially revert commit d30a8ec448bcd08c6a52a37d6ae41a4b71c235da
(Correct number format mapping for CJK numbered lists in rtf/doc/docx
filters., 2014-11-04).

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

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

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

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

diff --git a/sw/qa/extras/ooxmlexport/data/outline-num-none.odt 
b/sw/qa/extras/ooxmlexport/data/outline-num-none.odt
new file mode 100644
index 000..b3bb56d
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/outline-num-none.odt 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index e43cf90..ac4b246 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -584,6 +584,12 @@ DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist35, 
cjklist35.docx)
 CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_LOWER_ZH, numFormat);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testOOxmlOutlineNumNone, outline-num-none.odt)
+{
+if (xmlDocPtr pXmlDoc = parseExport(word/numbering.xml))
+assertXPath(pXmlDoc, 
/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt, val, none);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testNumParentStyle, num-parent-style.docx)
 {
 // This was Outline, i.e. w:numId was not imported from the Heading 2 
paragraph style.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 171d08c..873d0f9 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5582,7 +5582,7 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , 
const SfxItemSet *pOut
 case style::NumberingType::NUMBER_HANGUL_KO: 
aType=koreanDigital;break;
 case style::NumberingType::NUMBER_UPPER_KO: aType=koreanLegal; break;
 default:
-aType = decimal;break;
+aType = none;break;
 }
 return aType;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-06-04 Thread Miklos Vajna
 sw/qa/extras/rtfimport/rtfimport.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 123dc8f836afd108ea69804546116f17438a7861
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jun 3 19:20:02 2015 +0200

sw: fix Win-x86@51-TDF build

I forgot that the paste() method in this suite is not available on
Windows on 4-4, just on 5-0 and newer.

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

diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index bfa13c5..66f04e7 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2274,20 +2274,24 @@ DECLARE_RTFIMPORT_TEST(testTdf91074, tdf91074.rtf)
 
 DECLARE_RTFIMPORT_TEST(testTdf90260Nopar, hello.rtf)
 {
+#if !defined WNT
 uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
 uno::Referencetext::XTextRange xText(xTextDocument-getText(), 
uno::UNO_QUERY);
 uno::Referencetext::XTextRange xEnd = xText-getEnd();
 paste(tdf90260-nopar.rtf, xEnd);
 CPPUNIT_ASSERT_EQUAL(1, getParagraphs());
+#endif
 }
 
 DECLARE_RTFIMPORT_TEST(testTdf90260Par, hello.rtf)
 {
+#if !defined WNT
 uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
 uno::Referencetext::XTextRange xText(xTextDocument-getText(), 
uno::UNO_QUERY);
 uno::Referencetext::XTextRange xEnd = xText-getEnd();
 paste(tdf90260-par.rtf, xEnd);
 CPPUNIT_ASSERT_EQUAL(2, getParagraphs());
+#endif
 }
 
 DECLARE_RTFIMPORT_TEST(testTdf86814, tdf86814.rtf)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-06-03 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/tdf86814.rtf   |8 +++
 sw/qa/extras/rtfimport/rtfimport.cxx   |6 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   57 ++---
 3 files changed, 47 insertions(+), 24 deletions(-)

New commits:
commit 4c3afdb31382099005a16d2dd64a742c749f06ab
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon May 18 07:38:32 2015 +0200

tdf#86814 RTF import: fix sometimes lost bold style

The problem was that commit 76c0d0abc89cd8948706083c2660b71a2dad670c
(RTF import: adapt getProperties() to createStyleProperties(),
2014-09-07) only made the character style sprms/attributes a flat list,
but not the paragraph style ones. Fixing that inconsistency avoids the
tokenizer adding unwanted default sprms, which cause the bold sprms go
away in the bugdoc.

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

diff --git a/sw/qa/extras/rtfimport/data/tdf86814.rtf 
b/sw/qa/extras/rtfimport/data/tdf86814.rtf
new file mode 100644
index 000..6fb394e
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf86814.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+{\stylesheet
+{\s0 Normal;}
+{\s23\sbasedon0\snext23\sl288\slmult1\ql\widctlpar\faauto\li0\ri0\lin0\rin0\fi0\sb100\sa100\ltrpar\b\dbch\af10\langfe1049\dbch\af11\afs20\alang1025\ab\loch\f5\fs20\lang1049
 Style 23;}
+}
+\pard\plain 
\s23\sl288\slmult1\ql\widctlpar\faauto\li0\ri0\lin0\rin0\fi0\sb100\sa100\ltrpar\b\dbch\af10\langfe1049\dbch\af11\afs20\alang1025\ab\loch\f5\fs20\lang1049\ql\widctlpar\faauto\li0\ri0\lin0\rin0\fi0
+{\b\langfe1049\dbch\af11\afs20\alang1025\ab\rtlch \ltrch\loch\fs20\lang1049 
hello}
+\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 0a57d66..bfa13c5 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2290,6 +2290,12 @@ DECLARE_RTFIMPORT_TEST(testTdf90260Par, hello.rtf)
 CPPUNIT_ASSERT_EQUAL(2, getParagraphs());
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf86814, tdf86814.rtf)
+{
+// This was awt::FontWeight::NORMAL, i.e. the first run wasn't bold, when 
it should be bold (applied paragraph style with direct formatting).
+CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, 
getPropertyfloat(getRun(getParagraph(1), 1), CharWeight));
+}
+
 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 0941d85..75978e4 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -417,6 +417,32 @@ void RTFDocumentImpl::setNeedSect(bool bNeedSect)
 }
 }
 
+/// Copy rProps to rStyleAttributes and rStyleSprms, but in case of nested 
sprms, copy their children as toplevel sprms/attributes.
+static void lcl_copyFlatten(RTFReferenceProperties rProps, RTFSprms 
rStyleAttributes, RTFSprms rStyleSprms)
+{
+for (RTFSprms::Iterator_t it = rProps.getSprms().begin(); it != 
rProps.getSprms().end(); ++it)
+{
+// createStyleProperties() puts properties to rPr, but here we need a 
flat list.
+if (it-first == NS_ooxml::LN_CT_Style_rPr)
+{
+// rPr can have both attributes and SPRMs, copy over both types.
+RTFSprms rRPrSprms = it-second-getSprms();
+for (RTFSprms::Iterator_t itRPrSprm = rRPrSprms.begin(); itRPrSprm 
!= rRPrSprms.end(); ++itRPrSprm)
+rStyleSprms.set(itRPrSprm-first, itRPrSprm-second);
+
+RTFSprms rRPrAttributes = it-second-getAttributes();
+for (RTFSprms::Iterator_t itRPrAttribute = rRPrAttributes.begin(); 
itRPrAttribute != rRPrAttributes.end(); ++itRPrAttribute)
+rStyleAttributes.set(itRPrAttribute-first, 
itRPrAttribute-second);
+}
+else
+rStyleSprms.set(it-first, it-second);
+}
+
+RTFSprms rAttributes = rProps.getAttributes();
+for (RTFSprms::Iterator_t itAttr = rAttributes.begin(); itAttr != 
rAttributes.end(); ++itAttr)
+rStyleAttributes.set(itAttr-first, itAttr-second);
+}
+
 writerfilter::ReferenceProperties::Pointer_t 
RTFDocumentImpl::getProperties(RTFSprms rAttributes, RTFSprms rSprms)
 {
 int nStyle = 0;
@@ -431,34 +457,17 @@ writerfilter::ReferenceProperties::Pointer_t 
RTFDocumentImpl::getProperties(RT
 // let's merge paragraph and character style properties here.
 int nCharStyle = m_aStates.top().nCurrentCharacterStyleIndex;
 RTFReferenceTable::Entries_t::iterator itChar = 
m_aStyleTableEntries.find(nCharStyle);
-RTFSprms aStyleSprms = rProps.getSprms();
-RTFSprms aStyleAttributes = rProps.getAttributes();
+RTFSprms aStyleSprms;
+ 

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

2015-06-02 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/copypaste-footnote-paste.rtf |3 -
 sw/qa/extras/rtfimport/data/tdf90260-nopar.rtf   |2 +
 sw/qa/extras/rtfimport/data/tdf90260-par.rtf |2 +
 sw/qa/extras/rtfimport/rtfimport.cxx |   18 ++
 sw/source/filter/rtf/swparrtf.cxx|   25 ++-
 writerfilter/inc/rtftok/RTFDocument.hxx  |3 +
 writerfilter/source/dmapper/DomainMapper.cxx |3 +
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|4 +-
 writerfilter/source/filter/RtfFilter.cxx |2 -
 writerfilter/source/rtftok/rtfdocumentfactory.cxx|5 +--
 writerfilter/source/rtftok/rtfdocumentimpl.cxx   |   13 ---
 writerfilter/source/rtftok/rtfdocumentimpl.hxx   |6 +++
 12 files changed, 71 insertions(+), 15 deletions(-)

New commits:
commit f44ff6044e4ea20a3a40f65b3762fa0171b20e6e
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon May 11 23:24:22 2015 +0200

tdf#70318 tdf#90260 writerfilter: pasted RTF documents may contain no \par

This is a squash of 3 commits, as the first doesn't build without the
second one.

First commit:

sw core is not yet adapted, will be done in the next commit.

(cherry picked from commit e702c78843e387d83fd9c8fbd1597cbe27e3e656)

Second commit:

Author: Mike Kaganski mikekagan...@hotmail.com
tdf#70318: don't forget to clean up second fake paragraph

RTF insert is made into an empty paragraph. To do that, two splits
are made before the insert, but only one is reverted afterwards.
This patch removes the second.

Also fixes a memory leak from unreleased heap object

The corresponding unit test is corrected. It was incorrect
because \par doesn't begin new paragraph; it only ends paragraph.
If a RTF is ended with \par } then no newline is added to its end.
The old unit test only worked because of the bug fixed by this
patch. Correct way of inserting new paragraph in the end of a RTF
is \par \par}

(cherry picked from commit 0ddd9f9ff45f61013ea18763eca4c68aedce6caa)

Third commit:

tdf#90260 testcase

(cherry picked from commit 8931abc0b9fded1ee78eca6bf28e8d2438a76add)

Conflicts:
writerfilter/source/filter/RtfFilter.cxx
writerfilter/source/rtftok/rtfdocumentfactory.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx
sw/source/filter/rtf/swparrtf.cxx

Change-Id: If8da12427e0cdaced4c1c1776b9f0b8cbde5c57c
63d50a940d7960beb35f7d774c833ed8499acbef
06a5ff604e6782863c4a2d6e002c9d67d42912fb
Reviewed-on: https://gerrit.libreoffice.org/15963
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/rtfimport/data/copypaste-footnote-paste.rtf 
b/sw/qa/extras/rtfimport/data/copypaste-footnote-paste.rtf
index 1f4a75e..a7c6bb2 100644
--- a/sw/qa/extras/rtfimport/data/copypaste-footnote-paste.rtf
+++ b/sw/qa/extras/rtfimport/data/copypaste-footnote-paste.rtf
@@ -1,3 +1,2 @@
 {\rtf1
-bbb
-\par }
+bbb}
diff --git a/sw/qa/extras/rtfimport/data/tdf90260-nopar.rtf 
b/sw/qa/extras/rtfimport/data/tdf90260-nopar.rtf
new file mode 100644
index 000..c54eedd
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf90260-nopar.rtf
@@ -0,0 +1,2 @@
+{\rtf1\ansi\ansicpg1252\deff0\deflang1035{\fonttbl{\f0\fnil\fcharset0 
Calibri;}}
+\uc1\pard\sa200\sl276\slmult1\lang11\f0\fs22 simple}
diff --git a/sw/qa/extras/rtfimport/data/tdf90260-par.rtf 
b/sw/qa/extras/rtfimport/data/tdf90260-par.rtf
new file mode 100644
index 000..e2115b6
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf90260-par.rtf
@@ -0,0 +1,2 @@
+{\rtf1\ansi\ansicpg1252\deff0\deflang1035{\fonttbl{\f0\fnil\fcharset0 
Calibri;}}
+\uc1\pard\sa200\sl276\slmult1\lang11\f0\fs22 simple\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 535687f..0a57d66 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2272,6 +2272,24 @@ DECLARE_RTFIMPORT_TEST(testTdf91074, tdf91074.rtf)
 CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(COL_LIGHTRED), 
getPropertytable::BorderLine2(xShape, TopBorder).Color);
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf90260Nopar, hello.rtf)
+{
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencetext::XTextRange xText(xTextDocument-getText(), 
uno::UNO_QUERY);
+uno::Referencetext::XTextRange xEnd = xText-getEnd();
+paste(tdf90260-nopar.rtf, xEnd);
+CPPUNIT_ASSERT_EQUAL(1, getParagraphs());
+}
+
+DECLARE_RTFIMPORT_TEST(testTdf90260Par, hello.rtf)
+{
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencetext::XTextRange xText(xTextDocument-getText(), 
uno::UNO_QUERY);
+uno::Referencetext::XTextRange xEnd = 

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

2015-05-28 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/tdf91074.rtf   |7 +++
 sw/qa/extras/rtfimport/rtfimport.cxx   |7 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |6 ++-
 writerfilter/source/rtftok/rtfsdrimport.cxx|   45 ++---
 writerfilter/source/rtftok/rtfsdrimport.hxx|2 +
 5 files changed, 47 insertions(+), 20 deletions(-)

New commits:
commit fe898641dd7f8ff3cc74804f01340fdade3e5ed7
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon May 11 09:05:12 2015 +0200

tdf#91074 RTF import: handle \dplineco* for text frames

RTFSdrImport::resolve() already had the logic to use the relevant API
depending on if the shape is a text frame or not -- extract that to a
separate member function and use it from RTFDocumentImpl::popState(),
too.

(cherry picked from commit ec1a96e79e3e6225706151cb72eb3df763b0598d)

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

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

diff --git a/sw/qa/extras/rtfimport/data/tdf91074.rtf 
b/sw/qa/extras/rtfimport/data/tdf91074.rtf
new file mode 100644
index 000..ff3fe9b
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf91074.rtf
@@ -0,0 +1,7 @@
+{\rtf1\ansi\ansicpg1252\deff0\deftab720
+{\*\do\dobxpage\dobypage\dodhgt8192\dptxbx
+{\dptxbxtext\pard\plain
+inner\par }
+\dpx674\dpy725\dpxsize1875\dpysize1020\dplinecor255\dplinecog0\dplinecob0\dplinew40\dpfillfgcr0\dpfillfgcg0\dpfillfgcb0\dpfillbgcr0\dpfillbgcg0\dpfillbgcb0\dpfillpat0}
+\par
+outer\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 6c52362..535687f 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2265,6 +2265,13 @@ DECLARE_RTFIMPORT_TEST(testTdf86182, tdf86182.rtf)
 CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, 
getPropertysal_Int16(getParagraph(1), WritingMode));
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf91074, tdf91074.rtf)
+{
+// The file failed to load, as the border color was imported using the 
LineColor UNO property.
+uno::Referencedrawing::XShape xShape = getShape(1);
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(COL_LIGHTRED), 
getPropertytable::BorderLine2(xShape, TopBorder).Color);
+}
+
 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 ad9954b..b039ede 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -5541,7 +5541,11 @@ int RTFDocumentImpl::popState()
 xShape-setSize(awt::Size(rDrawing.nRight, rDrawing.nBottom));
 
 if (rDrawing.bHasLineColor)
-xPropertySet-setPropertyValue(LineColor, 
uno::makeAny(sal_uInt32((rDrawing.nLineColorR16) + (rDrawing.nLineColorG8) 
+ rDrawing.nLineColorB)));
+{
+uno::Any aLineColor = 
uno::makeAny(sal_uInt32((rDrawing.nLineColorR16) + (rDrawing.nLineColorG8) 
+ rDrawing.nLineColorB));
+uno::Any aLineWidth;
+RTFSdrImport::resolveLineColorAndWidth(bTextFrame, 
xPropertySet, aLineColor, aLineWidth);
+}
 if (rDrawing.bHasFillColor)
 xPropertySet-setPropertyValue(FillColor, 
uno::makeAny(sal_uInt32((rDrawing.nFillColorR16) + (rDrawing.nFillColorG8) 
+ rDrawing.nFillColorB)));
 else if (!bTextFrame)
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx 
b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 7969b0b..1ebaf46 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -128,6 +128,31 @@ void 
RTFSdrImport::resolveDhgt(uno::Referencebeans::XPropertySet const xPrope
 pHelper-addItem(xPropertySet, nZOrder);
 }
 
+void RTFSdrImport::resolveLineColorAndWidth(bool bTextFrame, const 
uno::Referencebeans::XPropertySet xPropertySet, uno::Any rLineColor, 
uno::Any rLineWidth)
+{
+if (!bTextFrame)
+{
+xPropertySet-setPropertyValue(LineColor, rLineColor);
+xPropertySet-setPropertyValue(LineWidth, rLineWidth);
+}
+else
+{
+static const char* aBorders[] =
+{
+TopBorder, LeftBorder, BottomBorder, RightBorder
+};
+for (unsigned int i = 0; i  SAL_N_ELEMENTS(aBorders); ++i)
+{
+table::BorderLine2 aBorderLine = 
xPropertySet-getPropertyValue(OUString::createFromAscii(aBorders[i])).gettable::BorderLine2();
+if (rLineColor.hasValue())
+aBorderLine.Color = rLineColor.getsal_Int32();
+if (rLineWidth.hasValue())
+

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

2015-05-26 Thread Caolán McNamara
 sw/qa/extras/ooxmlexport/data/hyperlink-field.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |8 
 sw/source/filter/ww8/docxattributeoutput.cxx  |   10 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 064b29e381dc48c5fcad027549159bdaeaa49c80
Author: Caolán McNamara caol...@redhat.com
Date:   Mon May 25 11:06:46 2015 +0100

fix assert on export of ooo40760-1.sxw to docx

and a pile more

Change-Id: I7334233c789bb0ed7a60387ef7d84dd34ab5a187
(cherry picked from commit 3185b6c8caf97afa602c864f588d079cbbe04038)
Reviewed-on: https://gerrit.libreoffice.org/15891
Tested-by: David Tardon dtar...@redhat.com
Reviewed-by: David Tardon dtar...@redhat.com

diff --git a/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt 
b/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt
new file mode 100644
index 000..0c265cf
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 20e3a00..4b1a79e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -230,6 +230,14 @@ DECLARE_OOXMLEXPORT_TEST(testFloatingTable, 
fdo77887.docx)
 }
 
 
+DECLARE_OOXMLEXPORT_TEST(testHyperlinkContainingPlaceholderField, 
hyperlink-field.odt)
+{
+xmlDocPtr pXmlDoc = parseExport(word/document.xml);
+
+if (!pXmlDoc)
+   return;
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTablePreferredWidth, tablePreferredWidth.docx)
 {
 xmlDocPtr pXmlDoc = parseExport(word/document.xml);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index d6ad76d..171d08c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1040,11 +1040,6 @@ void DocxAttributeOutput::EndRun()
 {
 StartField_Impl( *pIt );
 
-if ( m_pHyperlinkAttrList )
-{
-m_nFieldsInHyperlink++;
-}
-
 // Remove the field from the stack if only the start has to be 
written
 // Unknown fields should be removed too
 if ( !pIt-bClose || ( pIt-eType == ww::eUNKNOWN ) )
@@ -1054,6 +1049,11 @@ void DocxAttributeOutput::EndRun()
 pIt = m_Fields.erase( pIt );
 continue;
 }
+
+if ( m_pHyperlinkAttrList )
+{
+m_nFieldsInHyperlink++;
+}
 }
 ++pIt;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-05-25 Thread Mark Hung
 sw/qa/extras/ooxmlexport/data/tdf91261.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |   19 +++
 writerfilter/source/dmapper/DomainMapper.cxx |   21 -
 writerfilter/source/dmapper/PropertyIds.cxx  |2 ++
 writerfilter/source/dmapper/PropertyIds.hxx  |2 ++
 writerfilter/source/dmapper/PropertyMap.cxx  |5 +
 writerfilter/source/dmapper/PropertyMap.hxx  |2 ++
 7 files changed, 46 insertions(+), 5 deletions(-)

New commits:
commit 5ad8c6c313f3d540f93742e9308a2773937b3120
Author: Mark Hung mark...@gmail.com
Date:   Thu May 14 23:02:21 2015 +0800

tdf#91261: DOCX import: snapGrid property of paragraphs are ignored

Fix the situation for OOXML import filter:
a) While handling DocGrid type, SnapToChars was treated as
   None. Now it is implemented as described in the article:
http://linpeifeng.blogspot.tw/2007/02/text-grid-enhancement.html
   Both LinesAndChars and SnapToChars will be translated to
   Writer grid type  lines and characters, and set SnapToGrid
   property to false or true accordingly.

b) All the imported paragraphs snap to grid because SnapToGrid was
   appended to grabbag, now it allows SnapToGrid property in
   paragraph and paragraph styles to be imported properly.

Reviewed-on: https://gerrit.libreoffice.org/15732
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com
(cherry picked from commit b7c8c337d4ffad55fe111c9634c4c04afce78bad)

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

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf91261.docx 
b/sw/qa/extras/ooxmlexport/data/tdf91261.docx
new file mode 100644
index 000..6edb8b8
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf91261.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 5e05f6a..e43cf90 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -613,6 +613,25 @@ DECLARE_OOXMLEXPORT_TEST(testTdf88583, tdf88583.odt)
 CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(0x00cc00), 
getPropertysal_Int32(getParagraph(1), FillColor));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf91261, tdf91261.docx)
+{
+bool snapToGrid = true;
+uno::Reference text::XTextRange  xPara = getParagraph( 2 );
+uno::Reference beans::XPropertySet  properties( xPara, uno::UNO_QUERY);
+properties-getPropertyValue(SnapToGrid) = snapToGrid ;
+CPPUNIT_ASSERT_EQUAL(false, snapToGrid);
+
+uno::Reference beans::XPropertySet 
xStyle(getStyles(PageStyles)-getByName(Standard), uno::UNO_QUERY);
+sal_Int16 nGridMode;
+xStyle-getPropertyValue(GridMode) = nGridMode;
+CPPUNIT_ASSERT_EQUAL( sal_Int16(2), nGridMode);
+
+bool bGridSnapToChars;
+xStyle-getPropertyValue(GridSnapToChars) = bGridSnapToChars;
+CPPUNIT_ASSERT_EQUAL(true, bGridSnapToChars);
+
+}
+
 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 ad477c5..e1c5954 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -918,14 +918,18 @@ void DomainMapper::lcl_attribute(Id nName, Value  val)
 switch( nIntValue )
 {
 case NS_ooxml::LN_Value_doc_ST_DocGrid_default:
-case NS_ooxml::LN_Value_doc_ST_DocGrid_snapToChars:
-pSectionContext-SetGridType( 0 );
+pSectionContext-SetGridType(text::TextGridMode::NONE);
 break;
 case NS_ooxml::LN_Value_doc_ST_DocGrid_lines:
-pSectionContext-SetGridType( 1 );
+
pSectionContext-SetGridType(text::TextGridMode::LINES);
 break;
 case NS_ooxml::LN_Value_doc_ST_DocGrid_linesAndChars:
-pSectionContext-SetGridType( 2 );
+
pSectionContext-SetGridType(text::TextGridMode::LINES_AND_CHARS);
+pSectionContext-SetGridSnapToChars( false );
+break;
+case NS_ooxml::LN_Value_doc_ST_DocGrid_snapToChars:
+
pSectionContext-SetGridType(text::TextGridMode::LINES_AND_CHARS);
+pSectionContext-SetGridSnapToChars( true );
 break;
 default :
 OSL_FAIL(unknown SwTextGrid value);
@@ -1983,7 +1987,14 @@ void DomainMapper::sprmWithProps( Sprm rSprm, 
PropertyMapPtr rContext )

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

2015-05-19 Thread Vasily Melenchuk
 sw/qa/extras/htmlexport/data/tdf90905.odt |binary
 sw/qa/extras/htmlexport/htmlexport.cxx|9 +
 sw/source/filter/html/wrthtml.cxx |8 ++--
 3 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 7ce44f5f8e786a1bfd56aad8e30ef52702115ba2
Author: Vasily Melenchuk vasily.melenc...@cib.de
Date:   Mon May 4 17:24:09 2015 +0300

tdf#90905 fix for url encoding in internal urls

Do not try to use INetURLObject class for encoding of internal document 
links.
External URLs are encoded as before.

Change-Id: I90621819ed21c3f793171ac4ab3fc7d49ac69f56
Reviewed-on: https://gerrit.libreoffice.org/15625
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Michael Stahl mst...@redhat.com
(cherry picked from commit d82c035953347a19bbbc5eda61e1c9389bf3b73b)
Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/extras/htmlexport/data/tdf90905.odt 
b/sw/qa/extras/htmlexport/data/tdf90905.odt
new file mode 100644
index 000..cab8a04
Binary files /dev/null and b/sw/qa/extras/htmlexport/data/tdf90905.odt differ
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 47cffc7..54f7bf1 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -243,6 +243,15 @@ DECLARE_HTMLEXPORT_TEST(testExportUrlEncoding, 
tdf76291.odt)
 assertXPath(pDoc, /html/body/p/a[2], href, 
http://www.youtube.com/results?search_query=%E7%B2%B5%E8%AA%9Emvsm=12;);
 }
 
+DECLARE_HTMLEXPORT_TEST(testExportInternalUrl, tdf90905.odt)
+{
+htmlDocPtr pDoc = parseHtml(maTempFile);
+CPPUNIT_ASSERT(pDoc);
+
+// Internal url should be valid
+assertXPath(pDoc, /html/body/p/a, href, #0.0.1.Text|outline);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/wrthtml.cxx 
b/sw/source/filter/html/wrthtml.cxx
index 26b8ab6..5de95b2 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1198,8 +1198,12 @@ OUString SwHTMLWriter::convertHyperlinkHRefValue(const 
OUString rURL)
 }
 }
 }
-INetURLObject aURL( sURL );
-return URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), 
aURL.GetMainURL( INetURLObject::NO_DECODE ) );
+else
+{
+INetURLObject aURL(sURL);
+sURL = aURL.GetMainURL(INetURLObject::NO_DECODE);
+}
+return URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), sURL );
 }
 
 void SwHTMLWriter::OutHyperlinkHRefValue( const OUString rURL )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-05-18 Thread Michael Stahl
 sw/qa/extras/odfimport/odfimport.cxx |2 +-
 sw/source/core/unocore/unoframe.cxx  |7 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit fad75997e6060c63e6d79327573dd51950da1acb
Author: Michael Stahl mst...@redhat.com
Date:   Fri May 15 18:09:37 2015 +0200

tdf#91140: ODF import: try to ignore invalid draw:fill=solid

... which was apparently written by LO = 4.1 on a frame with image
background, under unknown circumstances.

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

diff --git a/sw/qa/extras/odfimport/odfimport.cxx 
b/sw/qa/extras/odfimport/odfimport.cxx
index 5db4370..1dfef14 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -562,7 +562,7 @@ DECLARE_ODFIMPORT_TEST(fdo81223, fdo81223.odt)
 uno::Referencebeans::XPropertySet xFrame(xIndexAccess-getByIndex(0), 
uno::UNO_QUERY);
 sal_Int32 nValue(0);
 xFrame-getPropertyValue(BackColor) = nValue;
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0xfeff), nValue);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0x), nValue);
 }
 
 DECLARE_ODFIMPORT_TEST(fdo90130_1, fdo90130-1.odt)
diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index a418203..7168777 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -254,8 +254,13 @@ bool 
BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet rToSet, const SfxI
 const uno::Any* pXFillBackgroundItem = 0; 
GetProperty(XATTR_FILLBACKGROUND, 0, pXFillBackgroundItem);
 const uno::Any* pOwnAttrFillBmpItem = 0; 
GetProperty(OWN_ATTR_FILLBMP_MODE, 0, pOwnAttrFillBmpItem);
 
+// tdf#91140: ignore SOLID fill style for determining if fill style is used
+// but there is a GraphicURL
+const bool bFillStyleUsed(pXFillStyleItem  pXFillStyleItem-hasValue() 
+(pXFillStyleItem-getdrawing::FillStyle() != drawing::FillStyle_SOLID
+ || !pGrURL));
 const bool bXFillStyleItemUsed(
-pXFillStyleItem ||
+bFillStyleUsed ||
 pXFillColorItem ||
 pXFillGradientItem || pXFillGradientNameItem ||
 pXFillHatchItem || pXFillHatchNameItem ||
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-05-01 Thread Michael Stahl
 sw/qa/core/macros-test.cxx|   31 +++
 sw/source/core/undo/undel.cxx |6 +-
 2 files changed, 36 insertions(+), 1 deletion(-)

New commits:
commit d70174ef1bc5894fe3cd46d4bda1dfd5f6422d39
Author: Michael Stahl mst...@redhat.com
Date:   Thu Apr 30 23:14:02 2015 +0200

tdf#90816: sw: fix bookmark loss in SwUndoDelete

_DelBookmarks() will actually delete marks that exactly match both start
and end position of the range, so restrict the call to only the
fully-deleted nodes that will be moved to the Undo-array.

(regression from 370febbf19a5f362394d1c9e69b12dcb218f6501)

(cherry picked from commit c7fb1d8334d2289906ac2a0a8c32946493d10e00)

Conflicts:
sw/qa/core/macros-test.cxx

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

diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index 3101de7..1f33c91 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -69,6 +69,7 @@ public:
 void testVba();
 #endif
 void testBookmarkDeleteAndJoin();
+void testBookmarkDeleteTdf90816();
 void testFdo55289();
 void testFdo68983();
 CPPUNIT_TEST_SUITE(SwMacrosTest);
@@ -79,6 +80,7 @@ public:
 CPPUNIT_TEST(testVba);
 #endif
 CPPUNIT_TEST(testBookmarkDeleteAndJoin);
+CPPUNIT_TEST(testBookmarkDeleteTdf90816);
 CPPUNIT_TEST(testFdo55289);
 CPPUNIT_TEST(testFdo68983);
 
@@ -204,6 +206,35 @@ void SwMacrosTest::testBookmarkDeleteAndJoin()
 }
 }
 
+void SwMacrosTest::testBookmarkDeleteTdf90816()
+{
+SwDoc *const pDoc = new SwDoc;
+pDoc-GetIDocumentUndoRedo().DoUndo(true); // bug is in SwUndoDelete
+SwNodeIndex aIdx(pDoc-GetNodes().GetEndOfContent(), -1);
+SwPaM aPaM(aIdx);
+
+IDocumentContentOperations  rIDCO(pDoc-getIDocumentContentOperations());
+rIDCO.AppendTxtNode(*aPaM.GetPoint());
+rIDCO.InsertString(aPaM, OUString(ABC));
+aPaM.Move(fnMoveBackward, fnGoCntnt);
+aPaM.SetMark();
+aPaM.Move(fnMoveBackward, fnGoCntnt);
+IDocumentMarkAccess  rIDMA = *pDoc-getIDocumentMarkAccess();
+sw::mark::IMark *pMark =
+rIDMA.makeMark(aPaM, test, IDocumentMarkAccess::MarkType::BOOKMARK);
+CPPUNIT_ASSERT(pMark);
+
+// delete the same selection as the bookmark
+rIDCO.DeleteAndJoin(aPaM, false);
+
+// bookmark still there?
+auto iter = rIDMA.getAllMarksBegin();
+CPPUNIT_ASSERT_MESSAGE(the bookmark was deleted,
+iter != rIDMA.getAllMarksEnd());
+CPPUNIT_ASSERT(*aPaM.Start() == (*iter)-GetMarkPos());
+CPPUNIT_ASSERT(*aPaM.End() == (*iter)-GetOtherMarkPos());
+}
+
 void SwMacrosTest::testFdo55289()
 {
 SwDoc *const pDoc = new SwDoc;
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 253ef99..0c5c1f1 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -156,7 +156,11 @@ SwUndoDelete::SwUndoDelete(
 {
 DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() );
 ::sw::UndoGuard const undoGuard(pDoc-GetIDocumentUndoRedo());
-_DelBookmarks(pStt-nNode, pEnd-nNode, nullptr, pStt-nContent, 
pEnd-nContent);
+if (nEndNode - nSttNode  1) // check for fully selected nodes
+{
+SwNodeIndex const start(pStt-nNode, +1);
+_DelBookmarks(start, pEnd-nNode);
+}
 }
 
 nSetPos = pHistory ? pHistory-Count() : 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-4' - sw/qa sw/source

2015-04-30 Thread Caolán McNamara
 sw/qa/extras/ooxmlexport/data/duplicate-east-asia.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |   12 -
 sw/source/filter/ww8/wrtw8esh.cxx |   38 +++---
 sw/source/filter/ww8/wrtww8.hxx   |2 
 4 files changed, 43 insertions(+), 9 deletions(-)

New commits:
commit 4a4dadc12777db78de60f64773f4737dd604419a
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Apr 23 13:47:29 2015 +0100

Resolves: tdf#85769 fix duplicate attribute export to docx...

with ooo69297-4.odt

(cherry picked from commit 870a7ee60ab01246ad8d9beae5705f59c6b73cbf)

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

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

diff --git a/sw/qa/extras/ooxmlexport/data/duplicate-east-asia.odt 
b/sw/qa/extras/ooxmlexport/data/duplicate-east-asia.odt
new file mode 100644
index 000..22b8a55
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/duplicate-east-asia.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 733434e..20e3a00 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -99,10 +99,18 @@ DECLARE_OOXMLEXPORT_TEST(testfdo76589 , fdo76589.docx)
 assertXPath ( pXmlDoc, 
/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText,val,%1 );
 }
 
+DECLARE_OOXMLEXPORT_TEST(testNoDuplicateAttributeExport, 
duplicate-east-asia.odt)
+{
+// File asserting while saving in LO.
+xmlDocPtr pXmlDoc = parseExport(word/document.xml);
+if (!pXmlDoc)
+return;
+}
+
 DECLARE_OOXMLEXPORT_TEST(testfdo79008, fdo79008.docx)
 {
-/* File getting crash while saving in LO.
- * Checking if document.xml file is getting created after fix
+/* File crashing while saving in LO.
+ * Check if document.xml file is created after fix
  */
 xmlDocPtr pXmlDoc = parseExport(word/document.xml);
 if (!pXmlDoc)
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index a2dd8ee..b93aa4f 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1162,9 +1162,30 @@ void MSWord_SdrAttrIter::OutEEField(const SfxPoolItem 
rHt)
 
 void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos )
 {
-OutParaAttr(true);
+//Collect the which ids belong to the run that we will export after
+//outputting the underlying paragraph attributes. We will exclude
+//writing these from the underlying paragraph attributes to avoid
+//duplicate attributes in docx export. Doesn't matter in doc
+//export as later props just override earlier ones.
+std::setsal_uInt16 aUsedRunWhichs;
+if (!aTxtAtrArr.empty())
+{
+for(std::vectorEECharAttrib::const_iterator i = aTxtAtrArr.begin(); 
i  aTxtAtrArr.end(); ++i)
+{
+if (nSwPos = i-nStart  nSwPos  i-nEnd)
+{
+sal_uInt16 nWhich = i-pAttr-Which();
+aUsedRunWhichs.insert(nWhich);
+}
+
+if( nSwPos  i-nStart )
+break;
+}
+}
 
-if(!aTxtAtrArr.empty())
+OutParaAttr(true, aUsedRunWhichs);
+
+if (!aTxtAtrArr.empty())
 {
 const SwModify* pOldMod = m_rExport.pOutFmtNode;
 m_rExport.pOutFmtNode = 0;
@@ -1274,7 +1295,7 @@ const SfxPoolItem MSWord_SdrAttrIter::GetItem( 
sal_uInt16 nWhich ) const
 return *pRet;
 }
 
-void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr)
+void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr, const 
std::setsal_uInt16* pWhichsToIgnore)
 {
 SfxItemSet aSet( pEditObj-GetParaAttribs( nPara ));
 if( aSet.Count() )
@@ -1288,9 +1309,14 @@ void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr)
 const SfxItemPool* pSrcPool = pEditPool,
  * pDstPool = m_rExport.pDoc-GetAttrPool();
 
-do {
-sal_uInt16 nWhich = pItem-Which(),
-   nSlotId = pSrcPool-GetSlotId( nWhich );
+do
+{
+sal_uInt16 nWhich = pItem-Which();
+
+if (pWhichsToIgnore  pWhichsToIgnore-find(nWhich) != 
pWhichsToIgnore-end())
+continue;
+
+sal_uInt16 nSlotId = pSrcPool-GetSlotId(nWhich);
 
 if ( nSlotId  nWhich != nSlotId 
  0 != ( nWhich = pDstPool-GetWhich( nSlotId ) ) 
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index c725847..d058107 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1477,7 +1477,7 @@ public:
 MSWord_SdrAttrIter( MSWordExportBase rWr, const EditTextObject rEditObj,
 sal_uInt8 nType );
 void NextPara( sal_Int32 nPar );
-void OutParaAttr(bool bCharAttr);
+void 

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

2015-04-30 Thread Miklos Vajna
 sw/qa/core/data/ooxml/pass/fill.docx |binary
 writerfilter/source/ooxml/model.xml  |6 --
 2 files changed, 6 deletions(-)

New commits:
commit 08ce53b292066ed732a00212d19893b4be80beb5
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Apr 30 09:49:16 2015 +0200

writerfilter: unused fill and CT_Fill resources

These were added by commit cfc4650c8594334edecc3b50ca54461f6bee2d43
(Added some teaks to 'model.xml', 2014-09-16), but the matching dmapper
part is missing, so they aren't useful in practice, and cause a crash on
import of crashtest's File_953.docx.

Change-Id: I3d1c138534a37dc9ba500f1134ca4bb9ebae0e96
(cherry picked from commit 57d254d42b6e1d836bd21e6fb2e968af2b511c7d)
Reviewed-on: https://gerrit.libreoffice.org/15574
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/fill.docx 
b/sw/qa/core/data/ooxml/pass/fill.docx
new file mode 100644
index 000..b9a4501
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fill.docx differ
diff --git a/writerfilter/source/ooxml/model.xml 
b/writerfilter/source/ooxml/model.xml
index ef288b1..ca1c464 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -9449,12 +9449,6 @@
 resource name=background resource=Properties
   element name=background tokenid=ooxml:background_background/
 /resource
-resource name=fill resource=Properties
-  element name=fill tokenid=ooxml:fill_fill/
-/resource
-resource name=CT_Fill resource=Properties
-  attribute name=type tokenid=ooxml:CT_Fill_type/
-/resource
   /namespace
   namespace name=vml-officeDrawing
 start name=shapedefaults/
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-04-24 Thread Miklos Vajna
 sw/qa/extras/rtfexport/data/tdf80708.rtf|   15 +++
 sw/qa/extras/rtfexport/rtfexport.cxx|   11 +++
 sw/source/filter/ww8/rtfattributeoutput.cxx |2 +-
 3 files changed, 27 insertions(+), 1 deletion(-)

New commits:
commit ffc80d79bf7c209607741cf6211dbe706990fea8
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Apr 20 16:38:32 2015 +0200

tdf#80708 RTF export: fix unexpected table row break

Regression from commit 1f77a5e8d5bf8a7f1b7bd7206996d2b2efc59462
(n#203704 fix RTF export table output for subtables, 2012-02-08), the
problem is that RtfAttributeOutput::StartTableRow() has two callers
depending on if it's the first or a later row, but the m_bTableRowEnded
flag storing if that method is called is only set in one case.

Fix the problem by moving the update of the flag to the method itself.

(cherry picked from commit 5e2708a5a8cad3c2f4578742264610abab677395)

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

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

diff --git a/sw/qa/extras/rtfexport/data/tdf80708.rtf 
b/sw/qa/extras/rtfexport/data/tdf80708.rtf
new file mode 100644
index 000..30b6174
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf80708.rtf
@@ -0,0 +1,15 @@
+{\rtf1
+\pard\plain
+{first table}
+\par 
\trowd\trql\trleft-108\ltrrow\trrh-374\trkeep\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\clbrdrl\brdrhair\brdrcf1\cellx296\clbrdrl\brdrhair\brdrcf1\clbrdrr\brdrhair\brdrcf1\cellx702\pard\plain
+{A1}
+\cell\pard\plain \s0\ql
+{A2}
+\cell\row\pard\pard\plain \s42\ql
+{\rtlch \ltrch\loch\lang2067 second table}
+\par 
\trowd\trql\trleft-108\ltrrow\trrh-561\trkeep\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\clbrdrl\brdrhair\brdrcf1\cellx296\clbrdrl\brdrhair\brdrcf1\clbrdrr\brdrhair\brdrcf1\cellx702\pard\plain
 \s0\ql
+{A1}
+\cell\pard\plain \s0\ql
+{A2}
+\cell\row\pard\pard\plain\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index bbd969d..2a13b4b 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -18,6 +18,7 @@
 #include com/sun/star/table/ShadowFormat.hpp
 #include com/sun/star/text/FontEmphasis.hpp
 #include com/sun/star/text/RelOrientation.hpp
+#include com/sun/star/text/TableColumnSeparator.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
 #include com/sun/star/text/XFootnotesSupplier.hpp
 #include com/sun/star/text/XPageCursor.hpp
@@ -858,6 +859,16 @@ DECLARE_RTFEXPORT_TEST(testTdf88583, tdf88583.odt)
 CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(0x00cc00), 
getPropertysal_Int32(getParagraph(1), FillColor));
 }
 
+DECLARE_RTFEXPORT_TEST(testTdf80708, tdf80708.rtf)
+{
+uno::Referencetext::XTextTablesSupplier xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xTables(xTextTablesSupplier-getTextTables(), uno::UNO_QUERY);
+uno::Referencetext::XTextTable xTable(xTables-getByIndex(1), 
uno::UNO_QUERY);
+uno::Referencetable::XTableRows xTableRows(xTable-getRows(), 
uno::UNO_QUERY);
+// This was 2, i.e. the second table had 3 cols, now 2 as expected.
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(1), getProperty 
uno::Sequencetext::TableColumnSeparator (xTableRows-getByIndex(0), 
TableColumnSeparators).getLength());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 84b031a..7071e7b 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -245,7 +245,6 @@ void 
RtfAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNo
 // In case of subtables, we may not get the first cell.
 if (pDeepInner  (pDeepInner-getCell() == 0 || m_bTableRowEnded))
 {
-m_bTableRowEnded = false;
 StartTableRow(pDeepInner);
 }
 
@@ -882,6 +881,7 @@ void 
RtfAttributeOutput::StartTableRow(ww8::WW8TableNodeInfoInner::Pointer_t pTa
 {
 sal_uInt32 nCurrentDepth = pTableTextNodeInfoInner-getDepth();
 SAL_INFO(sw.rtf, OSL_THIS_FUNC  , (depth is   nCurrentDepth  
));
+m_bTableRowEnded = false;
 
 TableDefinition(pTableTextNodeInfoInner);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-04-22 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/tdf86182.rtf   |4 
 sw/qa/extras/rtfimport/rtfimport.cxx   |7 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 502e606c84666df66fa1b099ae4147220f262841
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Apr 17 10:44:47 2015 +0200

tdf#86182 RTF import: fix handling of \rtlpar

Commit 558d5c25a0b1d6a937d33291a4b6cd7fca6cb15b (implement RTF_LTRPAR
and RTF_RTLPAR, 2011-06-09) was just a guess, this one is the proper
mapping.

(cherry picked from commit 4ee2a882dddb395a816cd54004b634d57cfb2446)

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

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

diff --git a/sw/qa/extras/rtfimport/data/tdf86182.rtf 
b/sw/qa/extras/rtfimport/data/tdf86182.rtf
new file mode 100644
index 000..d63c489
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf86182.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\rtlpar
+\u1662\'3f\u1587\'3f
+\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 8dce8ee..6c52362 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -45,6 +45,7 @@
 #include com/sun/star/text/WrapTextMode.hpp
 #include com/sun/star/text/HoriOrientation.hpp
 #include com/sun/star/text/VertOrientation.hpp
+#include com/sun/star/text/WritingMode2.hpp
 #include com/sun/star/util/XNumberFormatsSupplier.hpp
 
 #include rtl/ustring.hxx
@@ -2258,6 +2259,12 @@ DECLARE_RTFIMPORT_TEST(testFdo75614, tdf75614.rtf)
 CPPUNIT_ASSERT_EQUAL(OUString(after.), getRun(getParagraph(1), 
3)-getString());
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf86182, tdf86182.rtf)
+{
+// Writing mode was the default, i.e. text::WritingMode2::CONTEXT.
+CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, 
getPropertysal_Int16(getParagraph(1), WritingMode));
+}
+
 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 d589598..ad9954b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3028,7 +3028,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 case RTF_RTLPAR:
 {
 RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LTRPAR ? 0 : 
1));
-
m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_textDirection, 
pValue);
+m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_bidi, 
pValue);
 }
 break;
 case RTF_LTRROW:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-04-14 Thread Caolán McNamara
 sw/qa/extras/odfimport/data/fdo90130-1.odt |binary
 sw/qa/extras/odfimport/data/fdo90130-2.odt |binary
 sw/qa/extras/odfimport/odfimport.cxx   |   20 
 sw/source/core/unocore/unoframe.cxx|   23 +++
 4 files changed, 35 insertions(+), 8 deletions(-)

New commits:
commit 5c17754f824987b26b3aa2f126b383f117b2e63e
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Apr 13 20:56:45 2015 +0100

Resolves: tdf#90130 don't clobber new solid-color on seeing old transparency

...and tdf#90130 gradient transparency goes missing

(cherry picked from commit bc892b04144d82507ccd59953c9f4da357c2e7b4)

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

diff --git a/sw/qa/extras/odfimport/data/fdo90130-1.odt 
b/sw/qa/extras/odfimport/data/fdo90130-1.odt
new file mode 100644
index 000..6839b36
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo90130-1.odt differ
diff --git a/sw/qa/extras/odfimport/data/fdo90130-2.odt 
b/sw/qa/extras/odfimport/data/fdo90130-2.odt
new file mode 100644
index 000..6cf08950
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo90130-2.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx 
b/sw/qa/extras/odfimport/odfimport.cxx
index e880ee0..c0534d7 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -548,6 +548,26 @@ DECLARE_ODFIMPORT_TEST(fdo81223, fdo81223.odt)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0xfeff), nValue);
 }
 
+DECLARE_ODFIMPORT_TEST(fdo90130_1, fdo90130-1.odt)
+{
+uno::Referencetext::XTextFramesSupplier xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xIndexAccess(xTextFramesSupplier-getTextFrames(), uno::UNO_QUERY);
+uno::Referencebeans::XPropertySet xFrame(xIndexAccess-getByIndex(0), 
uno::UNO_QUERY);
+sal_Int32 nValue(0);
+xFrame-getPropertyValue(BackColor) = nValue;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff), nValue);
+}
+
+DECLARE_ODFIMPORT_TEST(fdo90130_2, fdo90130-2.odt)
+{
+uno::Referencetext::XTextFramesSupplier xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xIndexAccess(xTextFramesSupplier-getTextFrames(), uno::UNO_QUERY);
+uno::Referencebeans::XPropertySet xFrame(xIndexAccess-getByIndex(0), 
uno::UNO_QUERY);
+sal_Int32 nValue(0);
+xFrame-getPropertyValue(BackColorTransparency) = nValue;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(50), nValue);
+}
+
 DECLARE_ODFIMPORT_TEST(testBnc800714, bnc800714.fodt)
 {
 // Document's second paragraph wants to be together with the third one, 
but:
diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index db5cb5b..7cd950e 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -352,6 +352,9 @@ bool 
BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet rToSet, const SfxI
 
 aXFillColorItem.PutValue(*pXFillColorItem);
 rToSet.Put(aXFillColorItem);
+//set old-school brush color if we later encounter the
+//MID_BACK_COLOR_TRANSPARENCY case below
+aBrush = getSvxBrushItemFromSourceSet(rToSet, RES_BACKGROUND, 
false);
 }
 else if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID  
(pCol || pRGBCol))
 {
@@ -446,20 +449,24 @@ bool 
BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet rToSet, const SfxI
 }
 }
 
-if(pXFillTransparenceItem)
+if (pXFillTransparenceItem)
 {
-const XGradient aNullGrad(RGB_Color(COL_BLACK), 
RGB_Color(COL_WHITE));
 XFillTransparenceItem aXFillTransparenceItem;
-
 aXFillTransparenceItem.PutValue(*pXFillTransparenceItem);
 rToSet.Put(aXFillTransparenceItem);
 }
-else if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID  
pColTrans)
+else if (pColTrans)
 {
-// Fill style is set to solid, but no fill transparency is given.
-// On the other hand, we have a BackColorTransparency, so use that.
-aBrush.PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
-setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet);
+// No fill transparency is given.  On the other hand, we have a
+// BackColorTransparency, so use that.
+sal_Int8 nGraphicTransparency(0);
+*pColTrans = nGraphicTransparency;
+rToSet.Put(XFillTransparenceItem(nGraphicTransparency));
+if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID)
+{
+aBrush.PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
+setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet);
+}
  

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

2015-04-14 Thread Miklos Vajna
 sw/qa/extras/mailmerge/data/empty.odt |binary
 sw/qa/extras/mailmerge/mailmerge.cxx  |5 +
 sw/source/core/doc/docnew.cxx |   26 ++
 3 files changed, 31 insertions(+)

New commits:
commit 2d66204f9676e5a3361de0b6dcc5fcc5a4a625e2
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Apr 10 11:54:03 2015 +0200

tdf#90230 SwDoc::AppendDoc: take care of marks when inserting page break

SwDoc::AppendDoc() inserts nodes from an other document, and before
doing that, it inserts a page break at the end of the document. In case
there are marks at the end of the last paragraph, the insertion of the
page break moves them to the next page. This is a rare situation, but
happens e.g. when the source document is an empty one: then MM puts a
mark at the first paragraph of each inserted MM part, and then the first
paragraph == the last paragraph, so the mark of the only paragraph in
the document gets moved to the next page.

This is a problem on its own, but is detected by the SwIndexReg dtor
when that empty paragraph gets deleted later in SwNodes::Delete() called
by SwDoc::AppendDoc(), resulting in an assertion failure.

Triggered by commit a305a2c91420652db450b7f8edd140e1d69f42cf (use
bookmarks to mark mailmerge parts in a mailmerge document (fdo#80823),
2014-10-20), these not adjusted bookmarks were not detected before.

(cherry picked from commit 2819ee71da631116662401f14f8a0fb78c2a7f3a)

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

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

diff --git a/sw/qa/extras/mailmerge/data/empty.odt 
b/sw/qa/extras/mailmerge/data/empty.odt
new file mode 100644
index 000..311cb06
Binary files /dev/null and b/sw/qa/extras/mailmerge/data/empty.odt differ
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx 
b/sw/qa/extras/mailmerge/mailmerge.cxx
index 3ac9724..37bbed4 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -346,6 +346,11 @@ DECLARE_SHELL_MAILMERGE_TEST(testTdf89214, tdf89214.odt, 
10-testing-addresses
 CPPUNIT_ASSERT(!getPropertyOUString(xParagraph, ListId).isEmpty());
 }
 
+DECLARE_SHELL_MAILMERGE_TEST(testTdf90230, empty.odt, 
10-testing-addresses.ods, testing-addresses)
+{
+// MM of an empty document caused an assertion in the SwIndexReg dtor.
+executeMailMerge();
+}
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index c6d353b..95a3ded 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -985,6 +985,32 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc rSource, 
sal_uInt16 const nStartPageNu
 if ( pTargetPageDesc ) {
 OUString name = pTargetPageDesc-GetName();
 pTargetShell-InsertPageBreak( name, nStartPageNumber );
+
+// There is now a new empty text node on the new page. If it has
+// any marks, those are from the previous page: move them back
+// there, otherwise later we can't delete that empty text node.
+SwNodeIndex aNodeIndex(GetNodes().GetEndOfContent(), -1);
+if (SwTxtNode* pTxtNode = aNodeIndex.GetNode().GetTxtNode())
+{
+// Position of the last paragraph on the previous page.
+--aNodeIndex;
+SwPaM aPaM(aNodeIndex);
+// Collect the marks starting or ending at this text node.
+std::setsw::mark::IMark* aSeenMarks;
+IDocumentMarkAccess* pMarkAccess = getIDocumentMarkAccess();
+for (const SwIndex* pIndex = pTxtNode-GetFirstIndex(); 
pIndex; pIndex = pIndex-GetNext())
+{
+sw::mark::IMark* pMark = 
const_castsw::mark::IMark*(pIndex-GetMark());
+if (!pMark)
+continue;
+if (aSeenMarks.find(pMark) != aSeenMarks.end())
+continue;
+aSeenMarks.insert(pMark);
+}
+// And move them back.
+for (sw::mark::IMark* pMark : aSeenMarks)
+pMarkAccess-repositionMark(pMark, aPaM);
+}
 }
 }
 #ifdef DBG_UTIL
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - 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 a32b8e78b2847c39c3d51aad7f4a76a79370119c
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/15270
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 1d77187..8dce8ee 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2252,6 +2252,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 265fa1d..d589598 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2337,8 +2337,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-4' - sw/qa sw/source

2015-04-11 Thread Miklos Vajna
 sw/qa/extras/mailmerge/data/tdf89214.odt |binary
 sw/qa/extras/mailmerge/mailmerge.cxx |   12 
 sw/source/core/doc/docnum.cxx|6 +++---
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 384880cb2e395e359b152c5afe7d8ba56c5249ff
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Apr 9 14:20:44 2015 +0200

tdf#89214 SwDoc::GetUniqueNumRuleName: always return pChkStr if it's unused

Regression from commit bb00a0097900ae054401f7758a915047cfde4065 (do not
bother with nice unique names during mailmerge, 2014-11-08),
SwAttrSet::CopyToModify() expects that in case SwDoc::FindNumRulePtr()
returns 0 for a name, then the call to SwDoc::MakeNumRule() will use the
not found name (as SwDoc::GetUniqueNumRuleName() will return the just
checked name).

As a result, simply always returning a random unique name during mail
merge is a problem. Only return a cheap random unique name if no hint is
given.

(cherry picked from commit ceafd0a76fb062237f627cd9d49d4aad78cf3066)

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

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

diff --git a/sw/qa/extras/mailmerge/data/tdf89214.odt 
b/sw/qa/extras/mailmerge/data/tdf89214.odt
new file mode 100644
index 000..70def37
Binary files /dev/null and b/sw/qa/extras/mailmerge/data/tdf89214.odt differ
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx 
b/sw/qa/extras/mailmerge/mailmerge.cxx
index d17c835..3ac9724 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -334,6 +334,18 @@ DECLARE_SHELL_MAILMERGE_TEST(testPageBoundaries2Pages, 
simple-mail-merge-2pages
 }
 }
 
+DECLARE_SHELL_MAILMERGE_TEST(testTdf89214, tdf89214.odt, 
10-testing-addresses.ods, testing-addresses)
+{
+executeMailMerge();
+
+uno::Referencetext::XTextDocument xTextDocument(mxMMComponent, 
uno::UNO_QUERY);
+uno::Referencetext::XTextRange xParagraph(getParagraphOrTable(3, 
xTextDocument-getText()), uno::UNO_QUERY);
+// Make sure that we assert the right paragraph.
+CPPUNIT_ASSERT_EQUAL(OUString(a), xParagraph-getString());
+// This paragraph had a bullet numbering, make sure that the list id is 
not empty.
+CPPUNIT_ASSERT(!getPropertyOUString(xParagraph, ListId).isEmpty());
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 835b1e1..f767f9a 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -2188,13 +2188,13 @@ sal_uInt16 SwDoc::MakeNumRule( const OUString rName,
 
 OUString SwDoc::GetUniqueNumRuleName( const OUString* pChkStr, bool bAutoNum ) 
const
 {
-if( IsInMailMerge())
+// If we got pChkStr, then the caller expects that in case it's not yet
+// used, it'll be returned.
+if( IsInMailMerge()  !pChkStr )
 {
 OUString newName = MailMergeNumRule
 + OStringToOUString( DateTimeToOString( DateTime( DateTime::SYSTEM 
)), RTL_TEXTENCODING_ASCII_US )
 + OUString::number( mpNumRuleTbl-size() + 1 );
-if( pChkStr )
-newName += *pChkStr;
 return newName;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-04-09 Thread Michael Stahl
 sw/qa/extras/odfimport/data/tdf89802.fodt   |   56 
 sw/qa/extras/odfimport/odfimport.cxx|   12 ++
 xmloff/source/draw/XMLShapeStyleContext.cxx |   14 +++
 3 files changed, 82 insertions(+)

New commits:
commit 8dd46ca71dd8dcdb7fe52421392f02cde0d77f8a
Author: Michael Stahl mst...@redhat.com
Date:   Tue Apr 7 22:20:49 2015 +0200

tdf#89802: xmloff: fix ODF import of frame with empty style name ref

draw:fill-gradient-name= in the graphic properties now causes
BaseFrameProperties_Impl::FillBaseProperties() to fail and prevent
insertion of the SwXTextFrame.

(regression from 6e61ecd09679a66060f932835622821d39e92f01)

(cherry picked from commit db1d278dcc308c73eb5edebc20481c96e7f479d8)

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

diff --git a/sw/qa/extras/odfimport/data/tdf89802.fodt 
b/sw/qa/extras/odfimport/data/tdf89802.fodt
new file mode 100644
index 000..3d8601b
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/tdf89802.fodt
@@ -0,0 +1,56 @@
+?xml version=1.0 encoding=UTF-8?
+
+office:document 
xmlns:office=urn:oasis:names:tc:opendocument:xmlns:office:1.0 
xmlns:style=urn:oasis:names:tc:opendocument:xmlns:style:1.0 
xmlns:text=urn:oasis:names:tc:opendocument:xmlns:text:1.0 
xmlns:table=urn:oasis:names:tc:opendocument:xmlns:table:1.0 
xmlns:draw=urn:oasis:names:tc:opendocument:xmlns:drawing:1.0 
xmlns:fo=urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0 
xmlns:xlink=http://www.w3.org/1999/xlink; 
xmlns:dc=http://purl.org/dc/elements/1.1/; 
xmlns:meta=urn:oasis:names:tc:opendocument:xmlns:meta:1.0 
xmlns:number=urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0 
xmlns:svg=urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0 
xmlns:chart=urn:oasis:names:tc:opendocument:xmlns:chart:1.0 
xmlns:dr3d=urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0 
xmlns:math=http://www.w3.org/1998/Math/MathML; 
xmlns:form=urn:oasis:names:tc:opendocument:xmlns:form:1.0 
xmlns:script=urn:oasis:names:tc:opendocument:xmlns:script:1.0 
xmlns:config=urn:oas
 is:names:tc:opendocument:xmlns:config:1.0 
xmlns:ooo=http://openoffice.org/2004/office; 
xmlns:ooow=http://openoffice.org/2004/writer; 
xmlns:oooc=http://openoffice.org/2004/calc; 
xmlns:dom=http://www.w3.org/2001/xml-events; 
xmlns:xforms=http://www.w3.org/2002/xforms; 
xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xmlns:rpt=http://openoffice.org/2005/report; 
xmlns:of=urn:oasis:names:tc:opendocument:xmlns:of:1.2 
xmlns:xhtml=http://www.w3.org/1999/xhtml; 
xmlns:grddl=http://www.w3.org/2003/g/data-view#; 
xmlns:officeooo=http://openoffice.org/2009/office; 
xmlns:tableooo=http://openoffice.org/2009/table; 
xmlns:drawooo=http://openoffice.org/2010/draw; 
xmlns:calcext=urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0
 
xmlns:loext=urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0
 xmlns:field=urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0 
xmlns:formx=urn:openoffice:names:
 experimental:ooxml-odf-interop:xmlns:form:1.0 
xmlns:css3t=http://www.w3.org/TR/css3-text/; office:version=1.2 
office:mimetype=application/vnd.oasis.opendocument.text
+ office:metameta:initial-creatorms 
/meta:initial-creatormeta:creation-date2015-04-07T22:24:25.374012080/meta:creation-datedc:date2015-04-07T22:25:28.460806924/dc:datedc:creatorms
 
/dc:creatormeta:editing-durationPT1M3S/meta:editing-durationmeta:editing-cycles1/meta:editing-cyclesmeta:document-statistic
 meta:table-count=0 meta:image-count=0 meta:object-count=0 
meta:page-count=1 meta:paragraph-count=1 meta:word-count=1 
meta:character-count=3 
meta:non-whitespace-character-count=3/meta:generatorLibreOfficeDev/4.5.0.0.alpha0$Linux_X86_64
 
LibreOffice_project/52ae345470d8fa657817cf87b3e8e8c1b51bd7da/meta:generator/office:meta
+ office:font-face-decls
+  style:font-face style:name=Lohit Devanagari1 svg:font-family=apos;Lohit 
Devanagariapos;/
+  style:font-face style:name=Liberation Serif 
svg:font-family=apos;Liberation Serifapos; 
style:font-family-generic=roman style:font-pitch=variable/
+  style:font-face style:name=Liberation Sans 
svg:font-family=apos;Liberation Sansapos; style:font-family-generic=swiss 
style:font-pitch=variable/
+  style:font-face style:name=Lohit Devanagari svg:font-family=apos;Lohit 
Devanagariapos; style:font-family-generic=system 
style:font-pitch=variable/
+  style:font-face style:name=Source Han Sans CN Normal 
svg:font-family=apos;Source Han Sans CN Normalapos; 
style:font-family-generic=system style:font-pitch=variable/
+ /office:font-face-decls
+ office:styles
+  style:default-style style:family=graphic
+   style:graphic-properties svg:stroke-color=#3465a4 
draw:fill-color=#729fcf fo:wrap-option=no-wrap draw:shadow-offset-x=0.3cm 

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

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

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

RotateAngle of UNO type long

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

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


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

2015-03-21 Thread Justin Luth
 sw/qa/extras/ww8import/data/fdo68963.doc |binary
 1 file changed

New commits:
commit 9ac4e1b0b5b3c2eab2405f6403ea9cf84252b41a
Author: Justin Luth justin_l...@sil.org
Date:   Sat Mar 21 07:19:21 2015 +0300

fix git commit error to allow compiling

caused by Change-IdIc5bdc4b475f2eb7963cbcf3bf0ec74337daef5be

Change-Id: I83947bb852b1083d1b0983eb8a325fb935acbf31
Reviewed-on: https://gerrit.libreoffice.org/14938
Reviewed-by: Jean-Baptiste Faure jbfa...@libreoffice.org
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/qa/extras/ww8import/data/fdo68963.doc 
b/sw/qa/extras/ww8import/data/fdo68963.doc
new file mode 100644
index 000..b31741f
Binary files /dev/null and b/sw/qa/extras/ww8import/data/fdo68963.doc differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-03-19 Thread Justin Luth
 dev/null |binary
 sw/source/core/crsr/crossrefbookmark.cxx |2 +-
 sw/source/filter/ww8/ww8par5.cxx |   11 ++-
 3 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 92a43d05d14b1ab7b8bfb4052874d0f0e6c62ef9
Author: Justin Luth justin_l...@sil.org
Date:   Mon Mar 9 15:26:14 2015 +0300

tdf#89482 fix __refheading__ regression, set only CrossRefs as TOC.

bugfix tdf#68963 marked all __refheading__ bookmarks at TOC, but
those crossreferences were deleted if they are not recorded in
aReferencedTOCBookmarks.  Redesigned the fix to include _Toc in the
crossreference name that is auto-generated, which is how MSWord
differentiates the markers.

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

diff --git a/sw/qa/extras/ww8import/data/fdo68963.doc 
b/sw/qa/extras/ww8import/data/fdo68963.doc
deleted file mode 100644
index 4b331f0..000
Binary files a/sw/qa/extras/ww8import/data/fdo68963.doc and /dev/null differ
diff --git a/sw/source/core/crsr/crossrefbookmark.cxx 
b/sw/source/core/crsr/crossrefbookmark.cxx
index 700a3f2..67a25d0 100644
--- a/sw/source/core/crsr/crossrefbookmark.cxx
+++ b/sw/source/core/crsr/crossrefbookmark.cxx
@@ -72,7 +72,7 @@ namespace sw { namespace mark
 const vcl::KeyCode rCode,
 const OUString rName,
 const OUString rShortName)
-: CrossRefBookmark(rPaM, rCode, rName, rShortName, 
IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix())
+: CrossRefBookmark(rPaM, rCode, rName, rShortName, 
IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()+_Toc)
 { }
 
 bool CrossRefHeadingBookmark::IsLegalName(const OUString rName)
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 246d3f6..bbde7d7 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -102,7 +102,7 @@ namespace
 // #120879# - helper method to identify a bookmark name to match the 
internal TOC bookmark naming convention
 bool IsTOCBookmarkName( const ::rtl::OUString rName )
 {
-return rName.startsWith(_Toc) || 
rName.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix());
+return rName.startsWith(_Toc) || 
rName.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()+_Toc);
 }
 
 ::rtl::OUString EnsureTOCBookmarkName( const ::rtl::OUString rName )
@@ -1970,6 +1970,15 @@ eF_ResT SwWW8ImplReader::Read_F_Ref( WW8FieldDesc*, 
OUString rStr )
 
 OUString sBkmName(GetMappedBookmark(sOrigBkmName));
 
+// #i120879# add cross reference bookmark name prefix, if it
+// matches internal TOC bookmark naming convention
+if ( IsTOCBookmarkName( sBkmName ) )
+{
+sBkmName = EnsureTOCBookmarkName(sBkmName);
+// track sBookmarkName as referenced TOC bookmark.
+pReffedStck-aReferencedTOCBookmarks.insert( sBkmName );
+}
+
 SwGetRefField aFld(
 (SwGetRefFieldType*)rDoc.getIDocumentFieldsAccess().GetSysFldType( 
RES_GETREFFLD ),
 sBkmName,REF_BOOKMARK,0,eFormat);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-03-10 Thread Tobias Lippert
 sw/qa/core/test_ToxWhitespaceStripper.cxx|   14 ++
 sw/source/core/tox/ToxWhitespaceStripper.cxx |7 +++
 2 files changed, 21 insertions(+)

New commits:
commit 09669c4f89ad5c4c012ba114811b49f7805e3801
Author: Tobias Lippert d...@fastmail.fm
Date:   Sun Feb 22 13:59:03 2015 +0100

tdf#89520 Make TOX creation more robust

The code is now more robust and will accept illegal arguments.

Change-Id: I43ae82b953cea845fb170aa7b6e8d42470ad4e5e
Reviewed-on: https://gerrit.libreoffice.org/14580
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
(cherry picked from commit 4bdbea5447f36beb9cc33df173a89a49a9918290)
Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/qa/core/test_ToxWhitespaceStripper.cxx 
b/sw/qa/core/test_ToxWhitespaceStripper.cxx
index 30da0bd..5381933 100644
--- a/sw/qa/core/test_ToxWhitespaceStripper.cxx
+++ b/sw/qa/core/test_ToxWhitespaceStripper.cxx
@@ -32,10 +32,14 @@ class ToxWhitespaceStripperTest : public 
CppUnit::TestFixture
 void
 PositionAfterStringCanBeRequested();
 
+void
+InvalidPositionIsMappedToLastEntry();
+
 CPPUNIT_TEST_SUITE(ToxWhitespaceStripperTest);
 CPPUNIT_TEST(MappingCharactersToVariousStrippedStringsWorks);
 CPPUNIT_TEST(StrippingWhitespacesFromVariousStringsWorks);
 CPPUNIT_TEST(PositionAfterStringCanBeRequested);
+CPPUNIT_TEST(InvalidPositionIsMappedToLastEntry);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -141,6 +145,16 @@ 
ToxWhitespaceStripperTest::PositionAfterStringCanBeRequested()
 CPPUNIT_ASSERT_EQUAL(expected, 
sut.GetPositionInStrippedString(test.getLength()));
 }
 
+void
+ToxWhitespaceStripperTest::InvalidPositionIsMappedToLastEntry()
+{
+OUString test(ab  c);
+ToxWhitespaceStripper sut(test);
+sal_Int32 expected = 4; // the length of the string after merging the two 
whitespaces
+sal_Int32 result = sut.GetPositionInStrippedString(40); // a value past 
the original string length
+CPPUNIT_ASSERT_EQUAL(expected, result);
+}
+
 // Put the test suite in the registry
 CPPUNIT_TEST_SUITE_REGISTRATION(ToxWhitespaceStripperTest);
 
diff --git a/sw/source/core/tox/ToxWhitespaceStripper.cxx 
b/sw/source/core/tox/ToxWhitespaceStripper.cxx
index cd0024e..4918a73 100644
--- a/sw/source/core/tox/ToxWhitespaceStripper.cxx
+++ b/sw/source/core/tox/ToxWhitespaceStripper.cxx
@@ -10,6 +10,8 @@
 #include ToxWhitespaceStripper.hxx
 
 #include rtl/ustrbuf.hxx
+#include sal/log.hxx
+
 #include boost/numeric/conversion/cast.hpp
 
 namespace sw {
@@ -50,6 +52,11 @@ sal_Int32
 ToxWhitespaceStripper::GetPositionInStrippedString(sal_Int32 pos) const
 {
 size_t upos = boost::numeric_castsize_t(pos);
+if (upos = mNewPositions.size()) {
+SAL_WARN(sw.core, Requested position of TOX entry text which does 
not exist. 
+Maybe the formatting hint is corrupt?);
+return mNewPositions.back();
+}
 return mNewPositions.at(upos);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

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

(cherry picked from commit 38f2b8b3b16aab19a2564ec699d253d3dccecc3c)

Change-Id: Iedf8eacd37b8ed8e307a10e8ade32f53c7417c4a
Reviewed-on: https://gerrit.libreoffice.org/14571
Reviewed-by: Zolnai Tamás zolnaitamas2...@gmail.com
Tested-by: Zolnai Tamás zolnaitamas2...@gmail.com

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


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

2015-02-11 Thread Miklos Vajna
 sw/qa/extras/rtfexport/data/tdf88583.odt |binary
 sw/qa/extras/rtfexport/rtfexport.cxx |7 +++
 sw/source/filter/ww8/rtfexport.cxx   |9 +
 3 files changed, 16 insertions(+)

New commits:
commit 3e44fcca87fc8e1354d1d735f3a10e388f2f1d0b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Feb 2 10:27:28 2015 +0100

Related: tdf#88583 RTF export: need to take care of fill attributes when ...

.. building the color table

(cherry picked from commit 87a5cf7db1f070cbc4a674a1c12c805a2c950856)

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

diff --git a/sw/qa/extras/rtfexport/data/tdf88583.odt 
b/sw/qa/extras/rtfexport/data/tdf88583.odt
new file mode 100644
index 000..307ab1e
Binary files /dev/null and b/sw/qa/extras/rtfexport/data/tdf88583.odt differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index 221618d..bbd969d 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -851,6 +851,13 @@ DECLARE_RTFEXPORT_TEST(testFdo82006, fdo82006.rtf)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), 
getPropertysal_Int32(getParagraph(0), ParaBottomMargin));
 }
 
+DECLARE_RTFEXPORT_TEST(testTdf88583, tdf88583.odt)
+{
+// This was FillStyle_NONE, as background color was missing from the color 
table during export.
+CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, 
getPropertydrawing::FillStyle(getParagraph(1), FillStyle));
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(0x00cc00), 
getPropertysal_Int32(getParagraph(1), FillColor));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index b0261af..d85903e 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -52,6 +52,7 @@
 #if OSL_DEBUG_LEVEL  1
 #include iostream
 #endif
+#include svx/xflclit.hxx
 
 using ::editeng::SvxBorderLine;
 using namespace ::comphelper;
@@ -1046,6 +1047,14 @@ void RtfExport::OutColorTable()
 }
 }
 
+// TextFrame or paragraph background solid fill.
+nMaxItem = rPool.GetItemCount2(XATTR_FILLCOLOR);
+for (sal_uInt32 i = 0; i  nMaxItem; ++i)
+{
+if (const XFillColorItem* pItem = static_castconst 
XFillColorItem*(rPool.GetItem2(XATTR_FILLCOLOR, i)))
+InsColor(pItem-GetColorValue());
+}
+
 for (size_t n = 0; n  m_aColTbl.size(); ++n)
 {
 const Color rCol = m_aColTbl[ n ];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-02-09 Thread Miklos Vajna
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |6 +++---
 sw/source/core/unocore/unocrsrhelper.cxx |   10 +++---
 writerfilter/source/dmapper/CellColorHandler.cxx |   12 +---
 writerfilter/source/dmapper/PropertyIds.cxx  |2 ++
 writerfilter/source/dmapper/PropertyIds.hxx  |2 ++
 5 files changed, 23 insertions(+), 9 deletions(-)

New commits:
commit 5b48d5e25c8e7918f4669195144afb1fae049d41
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Feb 1 00:11:21 2015 +0100

Related: tdf#88583 writerfilter: import paragraph color as fill attributes

In theory this is to be in sync with the ODF import. In practice the old
UNO property seems not to have a proper fallback to populate the doc
model with the fillattributes, so without this even if the import result
is visible, it would be lost on ODF export.

Additionally, this detected a bug in SwUnoCursorHelper::makeRedline(),
where paragraph format redline tried to use the map of a text portion
instead of a paragraph.

(cherry picked from commit 24077b2d52ab3d0fd0db5afb25d8b94b62386e3e)

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 64dcfd7..5e05f6a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -10,6 +10,7 @@
 #include swmodeltestbase.hxx
 
 #include com/sun/star/awt/XBitmap.hpp
+#include com/sun/star/drawing/FillStyle.hpp
 #include com/sun/star/graphic/XGraphic.hpp
 #include com/sun/star/style/BreakType.hpp
 #include com/sun/star/text/FontEmphasis.hpp
@@ -608,9 +609,8 @@ DECLARE_OOXMLEXPORT_TEST(testNumOverrideStart, 
num-override-start.docx)
 
 DECLARE_OOXMLEXPORT_TEST(testTdf88583, tdf88583.odt)
 {
-if (xmlDocPtr pXmlDoc = parseExport())
-// w:pPr had no w:shd child element, paragraph background was lost.
-assertXPath(pXmlDoc, //w:pPr/w:shd, fill, 00CC00);
+CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, 
getPropertydrawing::FillStyle(getParagraph(1), FillStyle));
+CPPUNIT_ASSERT_EQUAL(static_castsal_Int32(0x00cc00), 
getPropertysal_Int32(getParagraph(1), FillColor));
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index efe476a..faa268c 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1219,9 +1219,13 @@ void makeRedline( SwPaM rPaM,
 // Check if the value exists
 if ( aRevertPropertiesValue = aRevertProperties )
 {
-// sw/source/core/unocore/unoport.cxx#83 is where it's decided what 
map gets used for a text portion
-// so it's PROPERTY_MAP_TEXTPORTION_EXTENSIONS, unless it's a redline 
portion
-SfxItemPropertySet const rPropSet = 
(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXTPORTION_EXTENSIONS));
+int nMap = 0;
+// Make sure that paragraph format gets its own map, otherwise e.g. 
fill attributes are not preserved.
+if (eType == nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT)
+nMap = PROPERTY_MAP_PARAGRAPH;
+else
+nMap = PROPERTY_MAP_TEXTPORTION_EXTENSIONS;
+SfxItemPropertySet const rPropSet = 
(*aSwMapProvider.GetPropertySet(nMap));
 
 // Check if there are any properties
 if (aRevertProperties.getLength())
diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx 
b/writerfilter/source/dmapper/CellColorHandler.cxx
index 632bc07..dc2bda9 100644
--- a/writerfilter/source/dmapper/CellColorHandler.cxx
+++ b/writerfilter/source/dmapper/CellColorHandler.cxx
@@ -21,6 +21,7 @@
 #include ConversionHelper.hxx
 #include TDefTableHandler.hxx
 #include ooxml/resourceids.hxx
+#include com/sun/star/drawing/FillStyle.hpp
 #include com/sun/star/drawing/ShadingPattern.hpp
 #include sal/macros.h
 #include filter/msfilter/util.hxx
@@ -268,9 +269,14 @@ TablePropertyMapPtr  CellColorHandler::getProperties()
 pPropertyMap-Insert(PROP_CHAR_SHADING_VALUE, uno::makeAny( 
nShadingPattern ));
 }
 
-pPropertyMap-Insert( m_OutputFormat == Form ? PROP_BACK_COLOR
-: m_OutputFormat == Paragraph ? PROP_PARA_BACK_COLOR
-: PROP_CHAR_BACK_COLOR, uno::makeAny( nApplyColor ));
+if (m_OutputFormat == Paragraph)
+{
+pPropertyMap-Insert(PROP_FILL_STYLE, 
uno::makeAny(drawing::FillStyle_SOLID));
+pPropertyMap-Insert(PROP_FILL_COLOR, uno::makeAny(nApplyColor));
+}
+else
+pPropertyMap-Insert( m_OutputFormat == Form ? PROP_BACK_COLOR
+: PROP_CHAR_BACK_COLOR, uno::makeAny( nApplyColor 
));
 
 createGrabBag(originalColor, 

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

2015-02-07 Thread Andras Timar
 sw/qa/extras/htmlexport/htmlexport.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 72812676b419b8d5fa32d06e5c45af73d08eac59
Author: Andras Timar andras.ti...@collabora.com
Date:   Sat Feb 7 11:32:49 2015 +0100

tdf#76291 adapt unit test to libreoffice-4-4

Change-Id: I12c74380b65e463be352825c7f1459393883283b

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index aaa43d6..47cffc7 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -237,9 +237,10 @@ DECLARE_HTMLEXPORT_TEST(testExportUrlEncoding, 
tdf76291.odt)
 {
 htmlDocPtr pDoc = parseHtml(maTempFile);
 CPPUNIT_ASSERT(pDoc);
-
+
 // Test URI encoded hyperlink with Chinese characters
-assertXPath(pDoc, /html/body/p/a, href, 
http://www.youtube.com/results?search_query=%E7%B2%B5%E8%AA%9Emvsm=12;);
+assertXPath(pDoc, /html/body/p/a[1], href, 
http://www.youtube.com/results?search_query=%E7%B2%B5%E8%AA%9Emvsm=12;);
+assertXPath(pDoc, /html/body/p/a[2], href, 
http://www.youtube.com/results?search_query=%E7%B2%B5%E8%AA%9Emvsm=12;);
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-02-05 Thread Miklos Vajna
 sw/qa/extras/ooxmlexport/data/tdf88583.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx   |7 +++
 sw/source/filter/ww8/ww8atr.cxx|8 
 3 files changed, 15 insertions(+)

New commits:
commit 776a0b7bae60215996e7d5a0f73a24417414b9bb
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Jan 31 10:55:39 2015 +0100

tdf#88583 MSWordExportBase: fix handling of paragraph background color

Regression from 7d9bb549d498d6beed2c4050c402d09643febdfa (Related:
i#124638 Second step of DrawingLayer FillAttributes..., 2014-06-02), the
problem was that exporters still expect an SvxBrushItem for the para
background color, while doc model was changed to have an XFillStyleItem
/ XFillColorItem pair instead.

(cherry picked from commit 60cdeb2d441a6bf5c55f511f574b2b9dd598fbb8)

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

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf88583.odt 
b/sw/qa/extras/ooxmlexport/data/tdf88583.odt
new file mode 100644
index 000..307ab1e
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf88583.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index c4a7934..64dcfd7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -606,6 +606,13 @@ DECLARE_OOXMLEXPORT_TEST(testNumOverrideStart, 
num-override-start.docx)
 CPPUNIT_ASSERT_EQUAL(sal_Int16(3), 
comphelper::SequenceAsHashMap(xRules-getByIndex(1))[StartWith].getsal_Int16());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf88583, tdf88583.odt)
+{
+if (xmlDocPtr pXmlDoc = parseExport())
+// w:pPr had no w:shd child element, paragraph background was lost.
+assertXPath(pXmlDoc, //w:pPr/w:shd, fill, 00CC00);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 5c87dd6..d105bf5 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -304,6 +304,14 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet 
rSet, bool bPapFmt, bool
  (nWhich = XATTR_FILL_FIRST  nWhich  XATTR_FILL_LAST))
 AttrOutput().OutputItem( *pItem );
 }
+
+// Has to be called after RES_PARATR_GRABBAG is processed.
+const XFillStyleItem* pXFillStyleItem(static_castconst 
XFillStyleItem*(rSet.GetItem(XATTR_FILLSTYLE)));
+if (pXFillStyleItem  pXFillStyleItem-GetValue() == 
drawing::FillStyle_SOLID  !rSet.HasItem(RES_BACKGROUND))
+{
+// Construct an SvxBrushItem, as expected by the exporters.
+AttrOutput().OutputItem(getSvxBrushItemFromSourceSet(rSet, 
RES_BACKGROUND));
+}
 }
 pISet = 0;  // fuer Doppel-Attribute
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-01-24 Thread Miklos Vajna
 sw/qa/extras/odfimport/odfimport.cxx |   20 
 sw/qa/extras/uiwriter/uiwriter.cxx   |3 ++-
 sw/source/uibase/wrtsh/select.cxx|   21 +
 3 files changed, 35 insertions(+), 9 deletions(-)

New commits:
commit d41349d8456361f8507f579d5bab388f56530b33
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Jan 3 11:40:41 2015 +0100

fdo#72486 SwWrtShell::SelAll: if in table, then call extended select all ...

... only in case the whole table is already selected

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

diff --git a/sw/qa/extras/odfimport/odfimport.cxx 
b/sw/qa/extras/odfimport/odfimport.cxx
index 2b24dc5..f1ea610 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -397,7 +397,13 @@ DECLARE_ODFIMPORT_TEST(testFdo37606, fdo37606.odt)
 SwShellCrsr* pShellCrsr = pWrtShell-getShellCrsr(false);
 
 {
-pWrtShell-SelAll();
+pWrtShell-SelAll(); // Selects A1.
+SwTxtNode rCellEnd = 
dynamic_castSwTxtNode(pShellCrsr-End()-nNode.GetNode());
+// fdo#72486 This was Hello., i.e. a single select-all selected the 
whole document, not just the cell only.
+CPPUNIT_ASSERT_EQUAL(OUString(A1), rCellEnd.GetTxt());
+
+pWrtShell-SelAll(); // Selects the whole table.
+pWrtShell-SelAll(); // Selects the whole document.
 SwTxtNode rStart = 
dynamic_castSwTxtNode(pShellCrsr-Start()-nNode.GetNode());
 CPPUNIT_ASSERT_EQUAL(OUString(A1), rStart.GetTxt());
 
@@ -434,7 +440,9 @@ DECLARE_ODFIMPORT_TEST(testFdo37606Copy, fdo37606.odt)
 CPPUNIT_ASSERT(pTxtDoc);
 SwWrtShell* pWrtShell = pTxtDoc-GetDocShell()-GetWrtShell();
 // Ctrl-A
-pWrtShell-SelAll();
+pWrtShell-SelAll(); // Selects A1.
+pWrtShell-SelAll(); // Selects the whole table.
+pWrtShell-SelAll(); // Selects the whole document.
 
 // Ctrl-C
 SwTransferable* pTransferable = new SwTransferable(*pWrtShell);
@@ -463,7 +471,9 @@ DECLARE_ODFIMPORT_TEST(testFdo69862, fdo69862.odt)
 SwWrtShell* pWrtShell = pTxtDoc-GetDocShell()-GetWrtShell();
 SwShellCrsr* pShellCrsr = pWrtShell-getShellCrsr(false);
 
-pWrtShell-SelAll();
+pWrtShell-SelAll(); // Selects A1.
+pWrtShell-SelAll(); // Selects the whole table.
+pWrtShell-SelAll(); // Selects the whole document.
 SwTxtNode rStart = 
dynamic_castSwTxtNode(pShellCrsr-Start()-nNode.GetNode());
 // This was Footnote., as Ctrl-A also selected footnotes, but it should 
not.
 CPPUNIT_ASSERT_EQUAL(OUString(A1), rStart.GetTxt());
@@ -480,7 +490,9 @@ DECLARE_ODFIMPORT_TEST(testFdo69979, fdo69979.odt)
 SwWrtShell* pWrtShell = pTxtDoc-GetDocShell()-GetWrtShell();
 SwShellCrsr* pShellCrsr = pWrtShell-getShellCrsr(false);
 
-pWrtShell-SelAll();
+pWrtShell-SelAll(); // Selects A1.
+pWrtShell-SelAll(); // Selects the whole table.
+pWrtShell-SelAll(); // Selects the whole document.
 SwTxtNode rStart = 
dynamic_castSwTxtNode(pShellCrsr-Start()-nNode.GetNode());
 // This was , as Ctrl-A also selected headers, but it should not.
 CPPUNIT_ASSERT_EQUAL(OUString(A1), rStart.GetTxt());
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 23b1e7d..7500b7d 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -189,7 +189,8 @@ void SwUiWriterTest::testFdo69893()
 SwDoc* pDoc = createDoc(fdo69893.odt);
 SwWrtShell* pWrtShell = pDoc-GetDocShell()-GetWrtShell();
 
-pWrtShell-SelAll();
+pWrtShell-SelAll(); // A1 is empty - selects the whole table.
+pWrtShell-SelAll(); // Selects the whole document.
 
 SwShellCrsr* pShellCrsr = pWrtShell-getShellCrsr(false);
 SwTxtNode rEnd = 
dynamic_castSwTxtNode(pShellCrsr-End()-nNode.GetNode());
diff --git a/sw/source/uibase/wrtsh/select.cxx 
b/sw/source/uibase/wrtsh/select.cxx
index 8e05860..bab2cd6 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -132,7 +132,12 @@ long SwWrtShell::SelAll()
 boost::scoped_ptrSwPosition pStartPos;
 boost::scoped_ptrSwPosition pEndPos;
 SwShellCrsr* pTmpCrsr = 0;
-if( !HasWholeTabSelection() )
+
+// Query these early, before we move the cursor.
+bool bHasWholeTabSelection = HasWholeTabSelection();
+bool bIsCursorInTable = IsCrsrInTbl();
+
+if (!bHasWholeTabSelection)
 {
 if ( IsSelection()  IsCrsrPtAtEnd() )
 SwapPam();
@@ -157,8 +162,16 @@ long SwWrtShell::SelAll()
 SttSelect();
 GoEnd(true, bMoveTable);
 
-bool bStartsWithTable = StartsWithTable();
-if (bStartsWithTable)
+bool 

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

2015-01-23 Thread Justin Luth
 sw/qa/extras/ww8import/data/fdo68963.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx |7 +++
 sw/source/filter/basflt/fltshell.cxx |2 +-
 sw/source/filter/ww8/ww8par5.cxx |   25 -
 4 files changed, 24 insertions(+), 10 deletions(-)

New commits:
commit 7aa6bf5a7c89c8d114c84eb24e3056568fb7c9df
Author: Justin Luth justin_l...@sil.org
Date:   Thu Jan 22 14:29:59 2015 +0300

fdo#68963 recognize __RefHeading__ bookmarks as TOC

LibreOffice recognizes MS Office TOC, but LO files saved as
.doc format had no text showing.  Now bookmarks using the LO
naming convention are also imported as TOC bookmarks.

testcase included

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

diff --git a/sw/qa/extras/ww8import/data/fdo68963.doc 
b/sw/qa/extras/ww8import/data/fdo68963.doc
new file mode 100644
index 000..4b331f0
Binary files /dev/null and b/sw/qa/extras/ww8import/data/fdo68963.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 5f4e0bc..edb07aa 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -515,6 +515,13 @@ DECLARE_WW8IMPORT_TEST(testLayoutHanging, fdo68967.doc)
 // This must not hang in layout
 }
 
+DECLARE_WW8IMPORT_TEST(testfdo68963, fdo68963.doc)
+{
+// The problem was that the text was not displayed.
+CPPUNIT_ASSERT ( OUString() != 
parseDump(/root/page/body/tab/row[2]/cell[1]/txt/Special, rText) );
+CPPUNIT_ASSERT_EQUAL( OUString(Topic 1), 
parseDump(/root/page/body/tab/row[2]/cell[1]/txt/Special, rText) );
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/basflt/fltshell.cxx 
b/sw/source/filter/basflt/fltshell.cxx
index d30a6db..53a9b66 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -917,7 +917,7 @@ SwFltBookmark::SwFltBookmark( const OUString rNa, const 
OUString rVa,
 // otherwise: Src Charset from argument for aName
 // Src Charset from filter for aVal ( Text )
 
-if ( IsTOCBookmark() )
+if ( IsTOCBookmark()  ! 
rNa.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()) )
 {
 maName = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
 maName += rNa;
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 1d46adb..246d3f6 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -102,7 +102,18 @@ namespace
 // #120879# - helper method to identify a bookmark name to match the 
internal TOC bookmark naming convention
 bool IsTOCBookmarkName( const ::rtl::OUString rName )
 {
-return rName.startsWith(_Toc);
+return rName.startsWith(_Toc) || 
rName.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix());
+}
+
+::rtl::OUString EnsureTOCBookmarkName( const ::rtl::OUString rName )
+{
+OUString sTmp = rName;
+if ( IsTOCBookmarkName ( rName ) )
+{
+if ( ! 
rName.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()) )
+sTmp = 
IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix() + rName;
+}
+return sTmp;
 }
 }
 
@@ -216,7 +227,7 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
 
 const OUString sOrigName = BookmarkToWriter(*pName);
 pReffedStck-NewAttr( aStart,
-  SwFltBookmark( sOrigName, aVal, pB-GetHandle(), 
IsTOCBookmarkName( sOrigName ) ));
+  SwFltBookmark( EnsureTOCBookmarkName( sOrigName ), 
aVal, pB-GetHandle(), IsTOCBookmarkName( sOrigName ) ));
 return 0;
 }
 
@@ -2062,8 +2073,7 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, 
OUString rStr )
 OUString sBookmarkName;
 if ( IsTOCBookmarkName( sName ) )
 {
-sBookmarkName = 
IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
-sBookmarkName += sName;
+sBookmarkName = EnsureTOCBookmarkName(sName);
 // track sBookmarkName as referenced TOC bookmark.
 pReffedStck-aReferencedTOCBookmarks.insert( sBookmarkName );
 }
@@ -2089,8 +2099,7 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, 
OUString rStr )
 OUString sPageRefBookmarkName;
 if ( IsTOCBookmarkName( sName ) )
 {
-sPageRefBookmarkName = 
IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
-sPageRefBookmarkName += sName;
+sPageRefBookmarkName = EnsureTOCBookmarkName(sName);
 // track sPageRefBookmarkName as referenced TOC bookmark.
 pReffedStck-aReferencedTOCBookmarks.insert( 

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

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

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

Resolves: fdo#87601 specific html doc hangs on load

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

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

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

2015-01-19 Thread Miklos Vajna
 sw/qa/extras/odfexport/data/gerrit13858.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx|   10 +++
 sw/source/core/docnode/node.cxx |3 ++
 sw/source/filter/xml/xmltble.cxx|   38 +---
 4 files changed, 37 insertions(+), 14 deletions(-)

New commits:
commit e15e4d3888c1ebd229acd8e676d28115edf622e3
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Dec 27 12:11:43 2014 +0100

fdo#84714 ODT export: write loext:table inside draw:custom-shape

(cherry picked from commit e4de5b40eb7220da2d337eb98d7905a98dc12c72)
(cherry picked from commit 80eb001e6a861c68f2915d4eebded5e36e1875f6)

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

diff --git a/sw/qa/extras/odfexport/data/gerrit13858.odt 
b/sw/qa/extras/odfexport/data/gerrit13858.odt
new file mode 100644
index 000..9b3dd37
Binary files /dev/null and b/sw/qa/extras/odfexport/data/gerrit13858.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index 2a706b6..df5da9c 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -402,6 +402,11 @@ DECLARE_ODFEXPORT_TEST(testTextboxRoundedCorners, 
textbox-rounded-corners.odt)
 uno::Referencetext::XTextTable xTable(getParagraphOrTable(1, xText), 
uno::UNO_QUERY);
 uno::Referencetext::XTextRange xCell(xTable-getCellByName(A1), 
uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(OUString(a), xCell-getString());
+
+// Table inside a textbox should be in the extension namespace.
+if (xmlDocPtr pXmlDoc = parseExport(content.xml))
+// This failed, as draw:custom-shape had a table:table child.
+assertXPath(pXmlDoc, //draw:custom-shape/loext:table, name, 
Table1);
 }
 
 DECLARE_ODFEXPORT_TEST(testImageWithSpecialID, 
document_with_two_images_with_special_IDs.odt)
@@ -459,6 +464,11 @@ DECLARE_ODFEXPORT_TEST(testFdo86963, fdo86963.odt)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage-getCount());
 }
 
+DECLARE_ODFEXPORT_TEST(testGerrit13858, gerrit13858.odt)
+{
+// Just make sure the output is valid.
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 2103ffd..d57b18f 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -717,6 +717,9 @@ SwFrmFmt* SwNode::GetFlyFmt() const
 for( sal_uInt16 n = 0; n  rFrmFmtTbl.size(); ++n )
 {
 SwFrmFmt* pFmt = rFrmFmtTbl[n];
+// Only Writer fly frames can contain Writer nodes.
+if (pFmt-Which() != RES_FLYFRMFMT)
+continue;
 const SwFmtCntnt rCntnt = pFmt-GetCntnt();
 if( rCntnt.GetCntntIdx() 
 rCntnt.GetCntntIdx()-GetNode() == pSttNd )
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 6e4b800..0460e06 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -50,6 +50,7 @@
 #include xmlexp.hxx
 #include boost/foreach.hpp
 #include o3tl/sorted_vector.hxx
+#include textboxhelper.hxx
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -461,10 +462,11 @@ class SwXMLTableInfo_Impl
 const SwTable *pTable;
 Reference  XTextSection  xBaseSection;
 bool bBaseSectionValid;
+sal_uInt32 m_nPrefix;
 
 public:
 
-inline SwXMLTableInfo_Impl( const SwTable *pTbl );
+inline SwXMLTableInfo_Impl( const SwTable *pTbl, sal_uInt16 nPrefix );
 
 const SwTable *GetTable() const { return pTable; }
 const SwFrmFmt *GetTblFmt() const { return pTable-GetFrmFmt(); }
@@ -472,11 +474,14 @@ public:
 bool IsBaseSectionValid() const { return bBaseSectionValid; }
 const Reference  XTextSection  GetBaseSection() const { return 
xBaseSection; }
 inline void SetBaseSection( const Reference  XTextSection  rBase );
+/// The namespace (table or loext) that should be used for the elements.
+sal_uInt16 GetPrefix() const { return m_nPrefix; }
 };
 
-inline SwXMLTableInfo_Impl::SwXMLTableInfo_Impl( const SwTable *pTbl ) :
+inline SwXMLTableInfo_Impl::SwXMLTableInfo_Impl( const SwTable *pTbl, 
sal_uInt16 nPrefix ) :
 pTable( pTbl ),
-bBaseSectionValid( false )
+bBaseSectionValid( false ),
+m_nPrefix(nPrefix)
 {
 }
 
@@ -719,7 +724,7 @@ void SwXMLExport::ExportTableAutoStyles( const SwTableNode 
rTblNd )
 SwXMLTableColumnsSortByWidth_Impl aExpCols;
 SwXMLTableFrmFmtsSort_Impl aExpRows;
 SwXMLTableFrmFmtsSort_Impl aExpCells;
-SwXMLTableInfo_Impl aTblInfo( rTbl );
+SwXMLTableInfo_Impl aTblInfo( rTbl, XML_NAMESPACE_TABLE );
 ExportTableLinesAutoStyles( rTbl.GetTabLines(), nAbsWidth, nBaseWidth,
 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - 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 42c261a9e459408653dd5dae548dcc5ba619cef1
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/13913
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 27fe3d6..471095c 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -744,6 +744,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 8d4f548..ad477c5 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2196,6 +2196,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 20bd4ce..3e7e4af 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4734,9 +4734,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 925d7ac..ef288b1 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -17281,6 +17281,22 @@
 resource name=CT_TrackChange resource=Properties
   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-4' - sw/qa sw/source

2015-01-07 Thread Miklos Vajna
 sw/qa/extras/odfexport/data/fdo86963.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx |8 
 sw/source/core/unocore/unodraw.cxx   |   13 +++--
 3 files changed, 19 insertions(+), 2 deletions(-)

New commits:
commit 6227d2fc60564f847a2ffd0b5f5d0fbf8ab49f5b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Dec 19 19:41:52 2014 +0100

fdo#86963 SwXShape: don't ask SwTextBoxHelper for ZOrder of child shapes

Regression from commit 01fc08c0b5c57fef8ad3755672f4266d85e849a5
(fdo#85554 SwXShape: fix getting ZOrder property when doc contains
TextBoxes, 2014-11-20), the problem was that we returned wrong ZOrder of
shapes inside group shapes.

In SwXShape::getPropertyValue(), pObj points to the Writer-interfacing
outermost group shape in case of shapes contained by group shapes, while
GetSvxShape() gives access to the real shape. Given that TextBoxes are
only possible at the highest level (and not inside group shapes), just
check if the two pointers are the same: when not, then no need to
convert anything.

With this, child shapes get back their original ZOrder -- before in case
the group shape had ZOrder=0, all its child shapes had ZOrder=0 as well.

(cherry picked from commit 97952280f0adbe195e6a2e0bab8a21a7e352a721)

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

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

diff --git a/sw/qa/extras/odfexport/data/fdo86963.odt 
b/sw/qa/extras/odfexport/data/fdo86963.odt
new file mode 100644
index 000..72896e1
Binary files /dev/null and b/sw/qa/extras/odfexport/data/fdo86963.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index d7360ba..2a706b6 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -451,6 +451,14 @@ DECLARE_ODFEXPORT_TEST(testImageWithSpecialID, 
document_with_two_images_with_sp
 }
 }
 
+DECLARE_ODFEXPORT_TEST(testFdo86963, fdo86963.odt)
+{
+// Export of this document failed with beans::UnknownPropertyException.
+uno::Referencedrawing::XDrawPageSupplier xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencedrawing::XDrawPage xDrawPage = 
xDrawPageSupplier-getDrawPage();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage-getCount());
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index b4e0b0b..9b09764 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1764,8 +1764,17 @@ uno::Any SwXShape::getPropertyValue(const OUString 
rPropertyName)
 const SdrObject* pObj = pFmt-FindRealSdrObject();
 if (pObj)
 {
-std::setconst SwFrmFmt* aTextBoxes = 
SwTextBoxHelper::findTextBoxes(pFmt-GetDoc());
-aRet = SwTextBoxHelper::getOrdNum(pObj, aTextBoxes);
+bool bConvert = true;
+if (SvxShape* pSvxShape = GetSvxShape())
+// In case of group shapes, pSvxShape points to 
the child shape, while pObj points to the outermost group shape.
+if (pSvxShape-GetSdrObject() != pObj)
+// Textboxes are not expected inside group 
shapes, so no conversion is necessary there.
+bConvert = false;
+if (bConvert)
+{
+std::setconst SwFrmFmt* aTextBoxes = 
SwTextBoxHelper::findTextBoxes(pFmt-GetDoc());
+aRet = SwTextBoxHelper::getOrdNum(pObj, 
aTextBoxes);
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-01-06 Thread Miklos Vajna
 sw/qa/extras/ww8export/ww8export.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1fa51103a1ea4034af6c746b34eeeddd39f7ab4f
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Jan 2 11:06:01 2015 +0100

CppunitTest_sw_ww8export: use SAL_NEWLINE_STRING

This makes CppunitTest_sw_ww8export pass on Windows again.

Change-Id: I16fed4eabbe7b9ccdcc0c71361b85b0e13f2245a
(cherry picked from commit 4d3b725000e537ce6199f0abd1c80580c9bf95c8)

diff --git a/sw/qa/extras/ww8export/ww8export.cxx 
b/sw/qa/extras/ww8export/ww8export.cxx
index 357b06a..e03c3cc 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -449,7 +449,7 @@ DECLARE_WW8EXPORT_TEST(testCommentedTable, 
commented-table.doc)
 uno::Referencetext::XTextContent xField(xFields-nextElement(), 
uno::UNO_QUERY);
 // After first import, there was an off-by-one during import, so this was 
efore.\nA1\nB1\nAfte. (Notice the additional e prefix.)
 // After export and import, things got worse, this was \nA1\nB1\nAfte.
-CPPUNIT_ASSERT_EQUAL(OUString(fore.\nA1\nB1\nAfte), 
xField-getAnchor()-getString());
+CPPUNIT_ASSERT_EQUAL(OUString(fore. SAL_NEWLINE_STRING A1 
SAL_NEWLINE_STRING B1 SAL_NEWLINE_STRING Afte), 
xField-getAnchor()-getString());
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-12-16 Thread Michael Stahl
 sw/qa/extras/htmlexport/data/fdo86857.html |   29 +
 sw/qa/extras/htmlexport/htmlexport.cxx |   15 +++
 sw/source/filter/html/wrthtml.cxx  |6 +-
 3 files changed, 49 insertions(+), 1 deletion(-)

New commits:
commit 8275fd953666198e67e82e517bd1bab8bf742683
Author: Michael Stahl mst...@redhat.com
Date:   Tue Dec 16 21:10:55 2014 +0100

fdo#86857: sw: fix HTML export of page style background color

SwPageDesc no longer contains RES_BACKGROUND but XATTR_FOO.

Change-Id: Ie722b0279f9d9831338f6613a4722010afd1543e
(cherry picked from commit 298e144f8235bb4fe48e204764ec0ba936f3b0c0)

diff --git a/sw/qa/extras/htmlexport/data/fdo86857.html 
b/sw/qa/extras/htmlexport/data/fdo86857.html
new file mode 100644
index 000..dc1fd88
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/fdo86857.html
@@ -0,0 +1,29 @@
+!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
+html
+head
+   meta http-equiv=content-type content=text/html; charset=utf-8/
+   title/title
+   meta name=generator content=LibreOfficeDev 4.3.6.0.0 (Linux)/
+   style type=text/css
+   @page { margin: 2cm }
+   p { margin-bottom: 0.25cm; line-height: 120% }
+   td p { margin-bottom: 0cm }
+   a:link { so-language: zxx }
+   /style
+/head
+body lang=de-DE bgcolor=#ff dir=ltr style=background: #ff
+table width=100% cellpadding=4 cellspacing=0
+   col width=256*
+   tr
+   td width=100% valign=top bgcolor=#66 style=border: 
1px solid #00; padding: 0.1cm
+   pbr/
+
+   /p
+   /td
+   /tr
+/table
+p style=margin-bottom: 0cm; line-height: 100%br/
+
+/p
+/body
+/html
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index fd07c75..d8c673c 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -89,6 +89,21 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo62336, 
fdo62336.docx)
 // If either of no-calc-layout or no-test-import is enabled, the crash 
does not occur
 }
 
+DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo86857, fdo86857.html)
+{
+// problem was that background color on page style was not exported
+uno::Referencecontainer::XNameAccess 
xPageStyles(getStyles(PageStyles));
+uno::Referencebeans::XPropertySet xStyle(xPageStyles-getByName(HTML), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff), getPropertysal_Int32(xStyle, 
BackColor));
+// check that table background color works, which still uses RES_BACKGROUND
+uno::Referencetext::XTextTablesSupplier xTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xTables(xTablesSupplier-getTextTables(), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables-getCount());
+uno::Referencetext::XTextTable xTable(xTables-getByIndex(0), 
uno::UNO_QUERY);
+uno::Referencetext::XTextRange xCell(xTable-getCellByName(A1), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0x66), getPropertysal_Int32(xCell, 
BackColor));
+}
+
 DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testCharacterBorder, charborder.odt)
 {
 
diff --git a/sw/source/filter/html/wrthtml.cxx 
b/sw/source/filter/html/wrthtml.cxx
index 28049c2..13add63 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -30,6 +30,7 @@
 #include i18nlangtag/languagetag.hxx
 #include sfx2/frmhtmlw.hxx
 #include svx/xoutbmp.hxx
+#include svx/unobrushitemhelper.hxx
 #include sfx2/htmlmode.hxx
 #include editeng/lrspitem.hxx
 #include editeng/colritem.hxx
@@ -1047,7 +1048,10 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 
rHeaderAttrs )
 
 const SfxItemSet rItemSet = pPageDesc-GetMaster().GetAttrSet();
 
-OutBackground( rItemSet, true );
+// fdo#86857 page styles now contain the XATTR_*, not RES_BACKGROUND
+SvxBrushItem const aBrushItem(
+getSvxBrushItemFromSourceSet(rItemSet, RES_BACKGROUND));
+OutBackground(aBrushItem, true);
 
 nDirection = GetHTMLDirection( rItemSet );
 OutDirection( nDirection );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-12-14 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 e1de94244c1b0419c1c3415c02381e8b7a87abe0
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.

Change-Id: Iffee41066d42822b699c478821645b9742df3f58
(cherry picked from commit 4568d1d298bf4fc98dcd86384743a04587a2fe6f)

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index e454a40..fd07c75 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -120,7 +120,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)
@@ -129,7 +129,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
+531100947a51530d42c1d92f9829818e31ca4ce9421c70e427440e80712a7a89b7c8fb0906003046a5311df31cf501a01f4d0ee1b80f00bd4c398558ee0340ff

[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - 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 7b16cf0f554680adadef19dfdf82c52243313e03
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

Change-Id: I0f3d35a0e64c9ce5646fa63eda317bee42de5540
(cherry picked from commit 4517c94000153eab6c034ea548698953dd93f794)

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 0e916d3..1edf58c 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2212,6 +2212,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 b4fa15b..20bd4ce 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3645,6 +3645,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-4' - sw/qa

2014-12-07 Thread Zolnai Tamás
 sw/qa/extras/globalfilter/globalfilter.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 64aa97e17a3500dae1e0085c5a94d1964e559321
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Sun Dec 7 18:39:27 2014 +0100

Fix build

Change-Id: Ibc6553c8f529eb7bcd3d97ebd2219c5047c5f9c0

diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx 
b/sw/qa/extras/globalfilter/globalfilter.cxx
index 7478753..fbb51d7 100644
--- a/sw/qa/extras/globalfilter/globalfilter.cxx
+++ b/sw/qa/extras/globalfilter/globalfilter.cxx
@@ -118,14 +118,14 @@ void Test::testSwappedOutImageExport()
 
 void Test::testLinkedGraphicRT()
 {
-const std::vectorOUString aFilterNames = {
+OUString aFilterNames[] = {
 writer8,
 //Rich Text Format,  Note: picture is there, but SwGrfNode is not 
found?
 MS Word 97,
 Office Open XML Text,
 };
 
-for( size_t nFilter = 0; nFilter  aFilterNames.size(); ++nFilter )
+for( size_t nFilter = 0; nFilter  SAL_N_ELEMENTS(aFilterNames); ++nFilter 
)
 {
 if (mxComponent.is())
 mxComponent-dispose();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-11-30 Thread Miklos Vajna
 sw/qa/extras/rtfimport/data/fdo72031.rtf   |1 
 sw/qa/extras/rtfimport/rtfimport.cxx   |9 ++--
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   26 +++--
 3 files changed, 24 insertions(+), 12 deletions(-)

New commits:
commit 4cf0b919ed1d3bede755f403774fb2dc05b86a2a
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Nov 29 11:43:10 2014 +0100

fdo#72031 RTF import: bogus call to getBestTextEncodingFromLocale()

There were two problems here. First, commit
bbe3627eece0c3486e7ea11f2f13377aaa3a8fed (rtftok: stop sending
sprm:CRgFtc{0,1,2} tokens, 2014-03-05) broke the use-case when the font
encoding is 0, but it's present. Before that commit, we parsed the font
encoding instantly; after that commit we parse it once we have a font
name. If we do that, then we have to have an idea if we have a font
encoding. Given that 0 is a valid encoding, use -1 for the have no
encoding case instead.

Second, commit 7839633fb356285652ed96f4bf3f85bcd5b561a4 (fdo#85889
handle pc, pca and mac rtf keywords in writerfilter, 2014-11-24) abused
m_nCurrentEncoding, which is meant to be used within the font table
only. The problem with this is that this way only the first font will
get the encoding, while the spec says it should be used in every context
where there is no other explicit encoding. Fix this by setting the
default encoding for those 3 control words instead -- and consider the
default encoding in getEncoding().

Change-Id: Ia1d71f8ce70f2a53a3770b4840e21362d082e71f
(cherry picked from commit fa15d039e3a553da8500c17190d27169a9477cf2)

diff --git a/sw/qa/extras/rtfimport/data/fdo72031.rtf 
b/sw/qa/extras/rtfimport/data/fdo72031.rtf
new file mode 100644
index 000..ee589da
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo72031.rtf
@@ -0,0 +1 @@
+{\rtf1\ansi\ansicpg1250\deff0\deflang1038{\fonttbl{\f0\fnil\fcharset2 
Symbol;}{\f1\fnil\fcharset238 MS Shell Dlg 
2;}}\viewkind4\uc1\pard\f0\fs23\'c5\f1\fs17\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 7dc67c3..0e916d3 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -66,7 +66,7 @@ public:
 virtual void preTest(const char* filename) SAL_OVERRIDE
 {
 m_aSavedSettings = Application::GetSettings();
-if (OString(filename) == fdo48023.rtf)
+if (OString(filename) == fdo48023.rtf || OString(filename) == 
fdo72031.rtf)
 {
 AllSettings aSettings(m_aSavedSettings);
 aSettings.SetLanguageTag(LanguageTag(ru));
@@ -82,7 +82,7 @@ public:
 
 virtual void postTest(const char* filename) SAL_OVERRIDE
 {
-if (OString(filename) == fdo48023.rtf || OString(filename) == 
fdo44211.rtf)
+if (OString(filename) == fdo48023.rtf || OString(filename) == 
fdo72031.rtf || OString(filename) == fdo44211.rtf)
 Application::SetSettings(m_aSavedSettings);
 }
 
@@ -2206,6 +2206,11 @@ DECLARE_RTFIMPORT_TEST(testFdo85889mac, 
fdo85889-mac.rtf)
 CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange-getString());
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo72031, fdo72031.rtf)
+{
+OUString aExpected(\xc3\x85, 2, RTL_TEXTENCODING_UTF8);
+CPPUNIT_ASSERT_EQUAL(aExpected, getRun(getParagraph(1), 1)-getString());
+}
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5bab89b..5fb1225 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -256,7 +256,7 @@ 
RTFDocumentImpl::RTFDocumentImpl(uno::Referenceuno::XComponentContext const x
   m_bObject(false),
   m_aFontTableEntries(),
   m_nCurrentFontIndex(0),
-  m_nCurrentEncoding(0),
+  m_nCurrentEncoding(-1),
   m_nDefaultFontIndex(-1),
   m_aStyleTableEntries(),
   m_nCurrentStyleIndex(0),
@@ -643,8 +643,14 @@ rtl_TextEncoding RTFDocumentImpl::getEncoding(int 
nFontIndex)
 {
 std::mapint, rtl_TextEncoding::iterator it = 
m_aFontEncodings.find(nFontIndex);
 if (it != m_aFontEncodings.end())
+// We have a font encoding associated to this font.
 return it-second;
-return 
msfilter::util::getBestTextEncodingFromLocale(Application::GetSettings().GetLanguageTag().getLocale());
+else if (m_aDefaultState.nCurrentEncoding != 
rtl_getTextEncodingFromWindowsCharset(0))
+// We have a default encoding.
+return m_aDefaultState.nCurrentEncoding;
+else
+// Guess based on locale.
+return 
msfilter::util::getBestTextEncodingFromLocale(Application::GetSettings().GetLanguageTag().getLocale());
 }
 else
 return m_pSuperstream-getEncoding(nFontIndex);
@@ -1165,10 +1171,10 @@ void RTFDocumentImpl::text(OUString rString)
 case 

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

2014-11-26 Thread Caolán McNamara
 sw/qa/core/data/rtf/pass/ooo121333-1.rtf   |   43 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   13 ++-
 2 files changed, 48 insertions(+), 8 deletions(-)

New commits:
commit c51c39ddf6d513afda83d4f15549c6277a0cc211
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Nov 26 12:44:10 2014 +

always pass bookmark name through to domainmapper

the rtf doc has three bookmark starts but only two matching
bookmark ends.

The tokenizer has three starts 0, 1, 2, but 0 is missing an end. Without the
end of 0, the mapper never inserts an entry for it, so later inserts the 
start
of rtftok index 1 as mapper index 0, and passing the end for a bare 1 
cannot
be found by index. If we pass the name then it finds it by name as mapper 
index
0 and all is well.

Change-Id: I344db84e4f1c7d55fca59cdfe692080c7d0b8033
(cherry picked from commit 2b54caceab9d975bffa7e24bf732cb877b16632f)
Reviewed-on: https://gerrit.libreoffice.org/13133
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/ooo121333-1.rtf 
b/sw/qa/core/data/rtf/pass/ooo121333-1.rtf
new file mode 100644
index 000..7f3b531
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/ooo121333-1.rtf
@@ -0,0 +1,43 @@
+{\rtf1\ansi\deff0\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New 
Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 
Arial;}{\f3\fswiss\fprq2\fcharset0 Trebuchet MS;}{\f4\fswiss\fprq2\fcharset128 
Arial;}{\f5\fswiss\fprq2\fcharset0 Arial Unicode MS;}{\f6\fnil\fprq2\fcharset0 
Mangal;}{\f7\fnil\fprq0\fcharset0 Mangal;}}
+{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
+{\stylesheet{\s0\snext0\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ltrpar\nowidctlpar\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\lang1081\loch\f0\fs24\lang1033
 Default;}
+{\s15\sbasedon0\snext16\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\ltrpar\cf0\kerning1\hich\af5\langfe2052\dbch\af6\loch\f2\fs28\lang1033
 Heading;}
+{\s16\sbasedon0\snext16\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\ltrpar\cf0\kerning1\hich\af0\langfe2052\dbch\af0\loch\f0\fs24\lang1033
 Text body;}
+{\s17\sbasedon16\snext17\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\ltrpar\cf0\kerning1\hich\af0\langfe2052\dbch\af7\loch\f0\fs24\lang1033
 List;}
+{\s18\sbasedon0\snext18\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\ltrpar\cf0\i\kerning1\hich\af0\langfe2052\dbch\af7\ai\loch\f0\fs24\lang1033
 Caption;}
+{\s19\sbasedon0\snext19\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ltrpar\cf0\kerning1\hich\af0\langfe2052\dbch\af7\loch\f0\fs24\lang1033
 Index;}
+}{\info{\author Lisa 
Stroyan}{\creatim\yr2012\mo11\dy10\hr15\min44}{\revtim\yr2012\mo11\dy10\hr16\min16}{\printim\yr0\mo0\dy0\hr0\min0}{\comment
 
OpenOffice.org}{\vern3410}}\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709
+
+{\*\pgdsctbl
+{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0
 Default;}}
+\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
+\pgndec\pard\plain 
\s0\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ltrpar\nowidctlpar\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\lang1081\loch\f0\fs24\lang1033{\rtlch
 \ltrch
+\'93}{\rtlch \ltrch\loch
+test\'94}
+\par \pard\plain 
\s0\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ltrpar\nowidctlpar\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\lang1081\loch\f0\fs24\lang1033{\rtlch
 \ltrch\loch
+}
+\par \pard\plain 
\s0\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ltrpar\nowidctlpar\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\lang1081\loch\f0\fs24\lang1033{\rtlch
 \ltrch\loch\f3
+\'93}{\rtlch \ltrch\loch\loch\f4
+Another }{\rtlch \ltrch\dbch\loch\f4
+\u21520\'3f}{\rtlch \ltrch\loch\loch\f4
+oo}{\rtlch \ltrch\loch\loch\f3
+ test\'94}
+\par \pard\plain 
\s0\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ltrpar\nowidctlpar\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\lang1081\loch\f0\fs24\lang1033{\rtlch
 \ltrch\loch
+}
+\par \pard\plain 
\s0\ql{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ltrpar\nowidctlpar\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\lang1081\loch\f0\fs24\lang1033{{\*\bkmkstart
 __DdeLink__132_187012832}\rtlch \ltrch\loch\loch\f3
+Created (or opened) testoocharacters.odt file with angled double quotes, using 
both Times and Trebuchet. Saved as RTF, closed, and reopened.}
+\par \pard\plain 

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

2014-11-21 Thread Eike Rathke
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e934ca0c21d390204e490ce92c9740930d50ba60
Author: Eike Rathke er...@redhat.com
Date:   Fri Nov 21 12:50:30 2014 +0100

WaE: ‘isNumber’ [-Werror=maybe-uninitialized]

Change-Id: I17ea9518e862b8c97c4c3f4564caedf9d045b7b3
(cherry picked from commit 82e5f287cc278781cdedee0d92fb4ce17cbc42bc)

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d120db3..c4a7934 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -57,7 +57,7 @@ protected:
 protected:
 bool CjkNumberedListTestHelper(sal_Int16 nValue)
 {
-bool isNumber;
+bool isNumber = false;
 uno::Referencetext::XTextRange xPara(getParagraph(1));
 uno::Reference beans::XPropertySet  properties( xPara, 
uno::UNO_QUERY);
 properties-getPropertyValue(NumberingIsNumber) = isNumber;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits