[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - 9 commits - configure.ac lotuswordpro/qa lotuswordpro/source sc/source sw/inc sw/qa sw/source vcl/source
Andras Timar
andras.timar at collabora.com
Sun Apr 10 19:17:32 UTC 2016
configure.ac | 2 -
lotuswordpro/qa/cppunit/data/fail/null-1.lwp |binary
lotuswordpro/qa/cppunit/data/fail/null-2.lwp |binary
lotuswordpro/qa/cppunit/data/fail/reference-1.lwp |binary
lotuswordpro/qa/cppunit/data/pass/null-1.lwp |binary
lotuswordpro/source/filter/lwpbulletstylemgr.cxx | 2 -
lotuswordpro/source/filter/lwpfrib.cxx | 3 +
lotuswordpro/source/filter/lwpfribsection.cxx | 8 ++--
lotuswordpro/source/filter/lwpsilverbullet.cxx | 24 +++++-------
lotuswordpro/source/filter/lwpsilverbullet.hxx | 4 +-
sc/source/core/data/formulacell.cxx | 14 ++++---
sw/inc/pagedesc.hxx | 1
sw/qa/extras/uiwriter/data/tdf97601.odt |binary
sw/qa/extras/uiwriter/uiwriter.cxx | 29 +++++++++++++++
sw/qa/extras/ww8import/data/tdf99100.doc |binary
sw/qa/extras/ww8import/data/tdf99120.doc |binary
sw/qa/extras/ww8import/ww8import.cxx | 18 +++++++++
sw/source/filter/ww8/ww8par.cxx | 3 +
sw/source/filter/ww8/ww8par.hxx | 2 +
sw/source/filter/ww8/ww8par5.cxx | 42 ++++++++++++++++++++--
sw/source/uibase/wrtsh/wrtsh1.cxx | 4 +-
vcl/source/font/PhysicalFontFamily.cxx | 7 +++
22 files changed, 129 insertions(+), 34 deletions(-)
New commits:
commit fb4d3c946e3f4de3c5f9e76c679753d1d1404f22
Author: Andras Timar <andras.timar at collabora.com>
Date: Sun Apr 10 21:24:41 2016 +0200
Bump version to 5.0-30
Change-Id: Ie5a64debd6e8aad9073d3399d0e542a368f8b451
diff --git a/configure.ac b/configure.ac
index 1aa0cf0..aed60719 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
# several non-alphanumeric characters, those are split off and used only for the
# ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
-AC_INIT([Collabora Office],[5.0.10.29],[],[],[https://CollaboraOffice.com/])
+AC_INIT([Collabora Office],[5.0.10.30],[],[],[https://CollaboraOffice.com/])
AC_PREREQ([2.59])
commit a3f7849844d85dca6a58c4e621252ee3d5e0c688
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Apr 9 15:35:43 2016 +0100
pCont can be null
Change-Id: I7af6c5f4a14e330924a1ea12ebb6328884b8a565
(cherry picked from commit 617bbc9da95f7e4b13e3a999fd3085a4fee23ae4)
Reviewed-on: https://gerrit.libreoffice.org/23937
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
(cherry picked from commit 23e3075976024da2b94dc432b38568f2cf7c402f)
diff --git a/lotuswordpro/qa/cppunit/data/pass/null-1.lwp b/lotuswordpro/qa/cppunit/data/pass/null-1.lwp
new file mode 100644
index 0000000..351d7e8
Binary files /dev/null and b/lotuswordpro/qa/cppunit/data/pass/null-1.lwp differ
diff --git a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
index 933f239..7d78284 100644
--- a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
+++ b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
@@ -293,7 +293,7 @@ XFContentContainer* LwpBulletStyleMgr::AddBulletList(
theList->SetContinueNumber(bContinue);
}
//Add the outer list to pCont
- if (nC == 0)
+ if (nC == 0 && pCont)
{
theList->SetStyleName(rStyleName);
pCont->Add(theList);
commit 168f8730e670a4ab6adef4fe7b48ed080af8b914
Author: Eike Rathke <erack at redhat.com>
Date: Wed Mar 23 14:26:55 2016 +0100
add a recursion guard to lcl_FindRangeNamesInUse()
Change-Id: Ifbc02304f5a2e080db2d6645e2c7f825a2c56cb5
Reviewed-on: https://gerrit.libreoffice.org/23473
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
(cherry picked from commit fecbcf523ee1e8a13b18ba1cfde36a2368da6949)
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index f9c92e6..ceb7f68 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3555,7 +3555,8 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY
StartListeningTo( pDocument ); // Listener as previous
}
-static void lcl_FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes, ScTokenArray* pCode, ScRangeName* pNames)
+static void lcl_FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes, ScTokenArray* pCode, ScRangeName* pNames,
+ int nRecursion)
{
for (FormulaToken* p = pCode->First(); p; p = pCode->Next())
{
@@ -3564,16 +3565,19 @@ static void lcl_FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes, ScTokenArray
sal_uInt16 nTokenIndex = p->GetIndex();
rIndexes.insert( nTokenIndex );
- ScRangeData* pSubName = pNames->findByIndex(p->GetIndex());
- if (pSubName)
- lcl_FindRangeNamesInUse(rIndexes, pSubName->GetCode(), pNames);
+ if (nRecursion < 126) // whatever.. 42*3
+ {
+ ScRangeData* pSubName = pNames->findByIndex(p->GetIndex());
+ if (pSubName)
+ lcl_FindRangeNamesInUse(rIndexes, pSubName->GetCode(), pNames, nRecursion+1);
+ }
}
}
}
void ScFormulaCell::FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes) const
{
- lcl_FindRangeNamesInUse( rIndexes, pCode, pDocument->GetRangeName() );
+ lcl_FindRangeNamesInUse( rIndexes, pCode, pDocument->GetRangeName(), 0);
}
void ScFormulaCell::SetChanged(bool b)
commit 1f2d5d96389f550a87e2c954da0bad9496ab78e9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Apr 8 09:25:46 2016 +0100
foundry may be null
Change-Id: I39359389a42e35e0131db1d0451fbd5531843f75
(cherry picked from commit b7bf06d5d6f640df1304b605a2eaa5276f998dcb)
Reviewed-on: https://gerrit.libreoffice.org/23911
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
(cherry picked from commit 88bd2f2037870b2c11688b22160d5d1d6df46172)
diff --git a/lotuswordpro/qa/cppunit/data/fail/null-2.lwp b/lotuswordpro/qa/cppunit/data/fail/null-2.lwp
new file mode 100644
index 0000000..cd7e072
Binary files /dev/null and b/lotuswordpro/qa/cppunit/data/fail/null-2.lwp differ
diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx
index 96833c7..a1b62b4 100644
--- a/lotuswordpro/source/filter/lwpfrib.cxx
+++ b/lotuswordpro/source/filter/lwpfrib.cxx
@@ -429,7 +429,8 @@ rtl::Reference<XFFont> LwpFrib::GetFont()
if(m_pModifiers&&m_pModifiers->FontID)
{
LwpFoundry* pFoundry = m_pPara->GetFoundry();
- pFont = pFoundry->GetFontManger().CreateFont(m_pModifiers->FontID);
+ if (pFoundry)
+ pFont = pFoundry->GetFontManger().CreateFont(m_pModifiers->FontID);
}
else
{
commit 08c0afe3efb776b28316423b3654f8879039f67e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Apr 6 08:34:28 2016 +0200
tdf#99100 DOC import: handle subset of STYLEREF natively
Commit 4215bca95511af8e4ee96e3c8f521b35f638aef3 (export 'Chapter' field
type as 'StyleRef' into .doc, 2015-08-21) mapped SwChapterField to
STYLEREF in the DOC export. This field type was handled as a field mark
on import. Instead of always handling it as a field mark, recognize the
case when it's the subset we write and we can handle natively, and in
that case create an SwChapterField again on import.
Leave the complex case unchanged as before and keep using field marks
for that.
Also (because the header where STYLEREF is used is completely empty
otherwise):
tdf#99120 DOC import: fix lack of first share after odd section break
Commit 848b1a05c5c41b5e7ff19c984f60c297a8143990 (fix for bnc#659631,
2011-02-04) made wwSectionManager::InsertSegments() use
SwPageDesc::WriteUseOn() directly, instead of going via
SwPageDesc::SetUseOn() that takes care of not throwing away the higher
share bits of the bitfield. This way the "is first shared" flag of the
bitfield got cleared, even when the input document had no title page
declared, so first header/footer must be shared.
Fix the problem by using SetUseOn() in the DOC import as well when it
comes to handling odd/even page section breaks.
(cherry picked from commits d635b351849b8b576c907abf22500d0fa89ab54f and
44a3eb37cd982c59f8350d53db3798b675230b35)
Conflicts:
sw/source/filter/ww8/ww8par5.cxx
Change-Id: Icfa8c4be6538da5e02e2d5071af30a46ccfa712b
Reviewed-on: https://gerrit.libreoffice.org/23889
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit f47143222ab5bacc48bc9a61b9d247e4a062fe9e)
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 5bdb738..50fcb7f 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -186,6 +186,7 @@ public:
bool IsHidden() const { return m_IsHidden; }
void SetHidden(bool const bValue) { m_IsHidden = bValue; }
+ /// Same as WriteUseOn(), but the >= PD_HEADERSHARE part of the bitfield is not modified.
inline void SetUseOn( UseOnPage eNew );
inline UseOnPage GetUseOn() const;
diff --git a/sw/qa/extras/ww8import/data/tdf99100.doc b/sw/qa/extras/ww8import/data/tdf99100.doc
new file mode 100644
index 0000000..6352ae3
Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf99100.doc differ
diff --git a/sw/qa/extras/ww8import/data/tdf99120.doc b/sw/qa/extras/ww8import/data/tdf99120.doc
new file mode 100644
index 0000000..a93721c
Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf99120.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 3a0860d..37bb2c2 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -535,6 +535,24 @@ DECLARE_WW8IMPORT_TEST(testfdo68963, "fdo68963.doc")
CPPUNIT_ASSERT ( -1 == parseDump("/root/page/body/txt[24]/Special[2]","rText").indexOf("Reference source not found"));
}
+DECLARE_WW8IMPORT_TEST(testTdf99100, "tdf99100.doc")
+{
+ uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText");
+ auto xField = getProperty< uno::Reference<lang::XServiceInfo> >(getRun(getParagraphOfText(1, xHeaderText), 2), "TextField");
+ // This failed: the second text portion wasn't a field.
+ CPPUNIT_ASSERT(xField.is());
+ CPPUNIT_ASSERT(xField->supportsService("com.sun.star.text.textfield.Chapter"));
+}
+
+DECLARE_WW8IMPORT_TEST(testTdf99120, "tdf99120.doc")
+{
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 1, odd."), parseDump("/root/page[1]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 1, even."), parseDump("/root/page[2]/header/txt/text()"));
+ // This failed: the header was empty on the 3rd page, as the first page header was shown.
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 2, odd."), parseDump("/root/page[3]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Section 2, even."), parseDump("/root/page[4]/header/txt/text()"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index f431305..59ff292 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4527,7 +4527,8 @@ void wwSectionManager::InsertSegments()
if ( aIter->maSep.bkc == 4 ) // Odd ( right ) Section break
eUseOnPage = nsUseOnPage::PD_RIGHT;
- aDesc.GetPageDesc()->WriteUseOn( eUseOnPage );
+ // Keep the share flags.
+ aDesc.GetPageDesc()->SetUseOn( eUseOnPage );
aDesc.GetPageDesc()->SetFollow( aFollow.GetPageDesc() );
}
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 0723912..e2c7e38 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1858,6 +1858,8 @@ public: // eigentlich private, geht aber leider nur public
eF_ResT Read_F_IncludePicture( WW8FieldDesc*, OUString& rStr );
eF_ResT Read_F_IncludeText( WW8FieldDesc*, OUString& rStr );
eF_ResT Read_F_Seq( WW8FieldDesc*, OUString& rStr );
+ /// Reads a STYLEREF field.
+ eF_ResT Read_F_Styleref(WW8FieldDesc*, OUString& rStr);
eF_ResT Read_F_OCX(WW8FieldDesc*, OUString&);
eF_ResT Read_F_Hyperlink(WW8FieldDesc*, OUString& rStr);
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 0d62c9a..0d0897d 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -723,7 +723,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
0,
&SwWW8ImplReader::Read_F_Tox, // 8
0,
- 0,
+ &SwWW8ImplReader::Read_F_Styleref, // 10
0,
&SwWW8ImplReader::Read_F_Seq, // 12
&SwWW8ImplReader::Read_F_Tox, // 13
@@ -875,8 +875,25 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
if (aF.nId != 88 && m_pPlcxMan->GetDoingDrawTextBox())
return aF.nLen;
+ bool bHasHandler = aWW8FieldTab[aF.nId] != nullptr;
+ if (aF.nId == ww::eSTYLEREF)
+ {
+ // STYLEREF, by default these are not handled.
+ bHasHandler = false;
+ sal_uInt64 nOldPos = m_pStrm->Tell();
+ OUString aStr;
+ aF.nLCode = m_pSBase->WW8ReadString(*m_pStrm, aStr, m_pPlcxMan->GetCpOfs() + aF.nSCode, aF.nLCode, m_eTextCharSet);
+ m_pStrm->Seek(nOldPos);
+
+ WW8ReadFieldParams aReadParam(aStr);
+ sal_Int32 nRet = aReadParam.SkipToNextToken();
+ if (nRet == -2 && !aReadParam.GetResult().isEmpty())
+ // Single numeric argument: this can be handled by SwChapterField.
+ bHasHandler = rtl::isAsciiDigit(aReadParam.GetResult()[0]);
+ }
+
// keine Routine vorhanden
- if (bNested || !aWW8FieldTab[aF.nId] || bCodeNest)
+ if (bNested || !bHasHandler || bCodeNest)
{
if( m_nFieldTagBad[nI] & nMask ) // Flag: Tag it when bad
return Read_F_Tag( &aF ); // Resultat nicht als Text
@@ -1415,6 +1432,27 @@ eF_ResT SwWW8ImplReader::Read_F_Seq( WW8FieldDesc*, OUString& rStr )
return FLD_OK;
}
+eF_ResT SwWW8ImplReader::Read_F_Styleref(WW8FieldDesc*, OUString& rString)
+{
+ WW8ReadFieldParams aReadParam(rString);
+ sal_Int32 nRet = aReadParam.SkipToNextToken();
+ if (nRet != -2)
+ // \param was found, not normal text.
+ return FLD_TAGIGN;
+
+ OUString aResult = aReadParam.GetResult();
+ sal_Int32 nResult = aResult.toInt32();
+ if (nResult < 1)
+ return FLD_TAGIGN;
+
+ SwFieldType* pFieldType = m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(RES_CHAPTERFLD);
+ SwChapterField aField(static_cast<SwChapterFieldType*>(pFieldType), CF_TITLE);
+ aField.SetLevel(nResult - 1);
+ m_rDoc.getIDocumentContentOperations().InsertPoolItem(*m_pPaM, SwFormatField(aField));
+
+ return FLD_OK;
+}
+
eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* pF, OUString& rStr )
{
sal_uInt16 nSub=0;
commit 3fb4e30f6bf0f14172f8a97b463fbb3735f21fb6
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Apr 6 00:20:28 2016 +0200
tdf#98989: vcl: fix handling of non-scalable fonts like "Courier"
For a VirtualDevice only scalable fonts are cloned, but for non-scalable
bitmap fonts still an empty PhysicalFontFamily with no PhysicalFontFace
is created, which causes text to disappear (height 0).
Suppress creation of such families like it was done in LO 4.3, so that
the fall-back can handle it and map "Courier" to "Courier New".
(regression from 8d6697587776136f3121733e1c29d4200720dbd9)
(cherry picked from commit 2f89245fb7e1c94bed49dde10b08ab1cf41b597b)
Change-Id: I6542a3f7a01bdf46ae2bcf328fa04064f7f86332
Reviewed-on: https://gerrit.libreoffice.org/23851
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
(cherry picked from commit 69e5f9528b453da1cdb08109ca5359ac518e1c4e)
diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx
index b3c650c..3077f79 100644
--- a/vcl/source/font/PhysicalFontFamily.cxx
+++ b/vcl/source/font/PhysicalFontFamily.cxx
@@ -270,7 +270,7 @@ void PhysicalFontFamily::UpdateCloneFontList( PhysicalFontCollection& rFontColle
{
// This is rather expensive to do per face.
OUString aFamilyName = GetEnglishSearchFontName( GetFamilyName() );
- PhysicalFontFamily* pFamily = rFontCollection.FindOrCreateFamily( aFamilyName );
+ PhysicalFontFamily* pFamily(nullptr);
for( PhysicalFontFace* pFace = mpFirst; pFace; pFace = pFace->GetNextFace() )
{
@@ -279,6 +279,11 @@ void PhysicalFontFamily::UpdateCloneFontList( PhysicalFontCollection& rFontColle
if( bEmbeddable && !pFace->IsEmbeddable() && !pFace->IsSubsettable() )
continue;
+ if (!pFamily)
+ { // tdf#98989 lazy create as family without faces won't work
+ pFamily = rFontCollection.FindOrCreateFamily( aFamilyName );
+ }
+ assert(pFamily);
PhysicalFontFace* pClonedFace = pFace->Clone();
assert( pClonedFace->GetFamilyName().replaceAll("-", "").trim() == GetFamilyName().replaceAll("-", "").trim() );
commit acd473eb381cc9bbab36fbf6749d84f65bff97a4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Mar 8 09:03:39 2016 +0100
tdf#97601 sw: don't mark an already modified chart as modified
Regression from commit e2b260fc98e833d4e64426b90992094f2da0498c (sw: let
layout not mark embedded object as modified, 2014-06-03), an infinite
loop was caused by:
1) SwDoc::SetOLEObjModified() triggering the maOLEModifiedIdle Idle
2) which at the end called SwWrtShell::CalcAndSetScale()
3) which at the end called chart::ChartModel::setModified()
4) where chart code called back into SwDoc::SetOLEObjModified() via the
modification listener, and this happened again and again.
The original fix wanted to avoid marking the document as modified
without a user interaction, so fix the bug by only calling setModified()
if it prevents a not-modified -> modified transition. This keeps the
original bug fixed, but prevents the infinite loop, that is always a
modified -> modified transition.
(cherry picked from commit 078c00e3a3c971ac83154948d5f08462532b9dc6)
Conflicts:
sw/qa/extras/uiwriter/uiwriter.cxx
Change-Id: I3b56a91afaacd3e0b7cb646a492fd15f1b5168ee
Reviewed-on: https://gerrit.libreoffice.org/23731
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: David Tardon <dtardon at redhat.com>
(cherry picked from commit 707c8cc24ddb8df805947472f5438f8f9c866d2a)
diff --git a/sw/qa/extras/uiwriter/data/tdf97601.odt b/sw/qa/extras/uiwriter/data/tdf97601.odt
new file mode 100644
index 0000000..d3995f2
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf97601.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index c864d17..29d9fc6 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -54,6 +54,8 @@
#include <com/sun/star/util/SearchFlags.hpp>
#include "com/sun/star/util/SearchAlgorithms.hpp"
#include "com/sun/star/i18n/TransliterationModulesExtra.hpp"
+#include <com/sun/star/chart2/data/XDataSource.hpp>
+#include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp>
#include <comphelper/propertysequence.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
@@ -98,6 +100,7 @@ public:
void testCp1000115();
void testTdf90003();
void testSearchWithTransliterate();
+ void testTdf97601();
void testTdf90362();
void testUndoCharAttribute();
void testTdf86639();
@@ -149,6 +152,7 @@ public:
CPPUNIT_TEST(testCp1000115);
CPPUNIT_TEST(testTdf90003);
CPPUNIT_TEST(testSearchWithTransliterate);
+ CPPUNIT_TEST(testTdf97601);
CPPUNIT_TEST(testTdf90362);
CPPUNIT_TEST(testUndoCharAttribute);
CPPUNIT_TEST(testTdf86639);
@@ -1014,6 +1018,31 @@ void SwUiWriterTest::testSearchWithTransliterate()
CPPUNIT_ASSERT_EQUAL(1,(int)case2);
}
+void SwUiWriterTest::testTdf97601()
+{
+ // Instructions from the bugreport to trigger an infinite loop.
+ createDoc("tdf97601.odt");
+ uno::Reference<text::XTextEmbeddedObjectsSupplier> xEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xEmbeddedObjects = xEmbeddedObjectsSupplier->getEmbeddedObjects();
+ uno::Reference<beans::XPropertySet> xChart;
+ xEmbeddedObjects->getByName("myChart") >>= xChart;
+ uno::Reference<chart2::data::XDataSource> xChartComponent;
+ xChart->getPropertyValue("Component") >>= xChartComponent;
+ uno::Sequence< uno::Reference<chart2::data::XLabeledDataSequence> > aDataSequences = xChartComponent->getDataSequences();
+ uno::Reference<document::XEmbeddedObjectSupplier2> xChartState(xChart, uno::UNO_QUERY);
+ xChartState->getExtendedControlOverEmbeddedObject()->changeState(1);
+ uno::Reference<util::XModifiable> xDataSequenceModifiable(aDataSequences[2]->getValues(), uno::UNO_QUERY);
+ xDataSequenceModifiable->setModified(true);
+
+ // Make sure that the chart is marked as modified.
+ uno::Reference<util::XModifiable> xModifiable(xChartComponent, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(true, bool(xModifiable->isModified()));
+ calcLayout();
+ // This never returned.
+ Application::Reschedule(true);
+ Scheduler::ProcessTaskScheduling(false);
+}
+
void SwUiWriterTest::testTdf90362()
{
// First check if the end of the second paragraph is indeed protected.
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 0a92d70..84a7922 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -657,7 +657,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
- // Action 'setVisualAreaSize' doesn't have to change the
+ // Action 'setVisualAreaSize' doesn't have to turn on the
// modified state of the document, either.
bool bModified = false;
uno::Reference<util::XModifiable> xModifiable(xObj->getComponent(), uno::UNO_QUERY);
@@ -665,7 +665,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
bModified = xModifiable->isModified();
xObj->setVisualAreaSize( nAspect, aSz );
xModifiable.set(xObj->getComponent(), uno::UNO_QUERY);
- if (xModifiable.is())
+ if (xModifiable.is() && xModifiable->isModified() && !bModified)
xModifiable->setModified(bModified);
// #i48419# - action 'UpdateReplacement' doesn't
commit 175b3c17e10e88560c1a40cff80d2a71d9751032
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Apr 4 10:36:26 2016 +0100
currentlayout may be null
Change-Id: I1e53482e722b82f052434f45e37a2fbdb2ea6ffc
(cherry picked from commit a4bc9a43198074b529693f1852093d8d72eaae98)
Reviewed-on: https://gerrit.libreoffice.org/23804
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: David Tardon <dtardon at redhat.com>
(cherry picked from commit 51b4af045d670c67f107922b2137fea49e042606)
diff --git a/lotuswordpro/qa/cppunit/data/fail/null-1.lwp b/lotuswordpro/qa/cppunit/data/fail/null-1.lwp
new file mode 100644
index 0000000..06b8254
Binary files /dev/null and b/lotuswordpro/qa/cppunit/data/fail/null-1.lwp differ
diff --git a/lotuswordpro/source/filter/lwpfribsection.cxx b/lotuswordpro/source/filter/lwpfribsection.cxx
index 74cc81d..b5c457a 100644
--- a/lotuswordpro/source/filter/lwpfribsection.cxx
+++ b/lotuswordpro/source/filter/lwpfribsection.cxx
@@ -317,11 +317,11 @@ bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib)
XFSectionStyle* pSectStyle= new XFSectionStyle();
//set margin
pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID().obj().get());
- if (pStory)
+ LwpPageLayout* pCurrentLayout = pStory ? pStory->GetCurrentLayout() : nullptr;
+ if (pCurrentLayout)
{
- LwpPageLayout* pCurrentLayout = pStory->GetCurrentLayout();
- double fLeft = m_pLayout->GetMarginsValue(MARGIN_LEFT)- pCurrentLayout->GetMarginsValue(MARGIN_LEFT);
- double fRight = m_pLayout->GetMarginsValue(MARGIN_RIGHT)- pCurrentLayout->GetMarginsValue(MARGIN_RIGHT);
+ double fLeft = m_pLayout->GetMarginsValue(MARGIN_LEFT) - pCurrentLayout->GetMarginsValue(MARGIN_LEFT);
+ double fRight = m_pLayout->GetMarginsValue(MARGIN_RIGHT) - pCurrentLayout->GetMarginsValue(MARGIN_RIGHT);
pSectStyle->SetMarginLeft(fLeft);
pSectStyle->SetMarginRight(fRight);
}
commit de2268c05e0595944fdcbc3fcb73c7c29e134fd1
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Apr 4 09:34:36 2016 +0100
hold bullet para by reference
(cherry picked from commit c9a04aed449c3cf992224cfedcee7f330357b01a)
Change-Id: I58025ea906426a7db4079042fa38954f1a3d076b
Reviewed-on: https://gerrit.libreoffice.org/23799
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: David Tardon <dtardon at redhat.com>
(cherry picked from commit c64235f4928754120a6a0817a1368b7abc924f8d)
diff --git a/lotuswordpro/qa/cppunit/data/fail/reference-1.lwp b/lotuswordpro/qa/cppunit/data/fail/reference-1.lwp
new file mode 100644
index 0000000..d8141ae
Binary files /dev/null and b/lotuswordpro/qa/cppunit/data/fail/reference-1.lwp differ
diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx
index e7ad33f..eb7c04af 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.cxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx
@@ -76,16 +76,12 @@ LwpSilverBullet::LwpSilverBullet(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
, m_nFlags(0)
, m_nUseCount(0)
, m_pAtomHolder(new LwpAtomHolder)
- , m_pBulletPara(NULL)
{
}
LwpSilverBullet::~LwpSilverBullet()
{
- if (m_pAtomHolder)
- {
- delete m_pAtomHolder;
- }
+ delete m_pAtomHolder;
}
void LwpSilverBullet::Read()
@@ -129,7 +125,7 @@ void LwpSilverBullet::RegisterStyle()
{
ParaNumbering aParaNumbering;
//get numbering format according to the position.
- m_pBulletPara->GetParaNumber(nPos, &aParaNumbering);
+ m_xBulletPara->GetParaNumber(nPos, &aParaNumbering);
LwpFribParaNumber* pParaNumber = aParaNumbering.pParaNumber;
if (pParaNumber)
{
@@ -205,7 +201,7 @@ OUString LwpSilverBullet::GetBulletFontName()
LwpFontManager& rFontMgr = m_pFoundry->GetFontManger();
- sal_uInt32 nBulletFontID = m_pBulletPara->GetBulletFontID();
+ sal_uInt32 nBulletFontID = m_xBulletPara->GetBulletFontID();
sal_uInt16 nFinalFont = static_cast<sal_uInt16>((nBulletFontID >> 16) & 0xFFFF);
//final fontid is valid?
@@ -226,7 +222,7 @@ OUString LwpSilverBullet::GetBulletFontName()
*/
UChar32 LwpSilverBullet::GetBulletChar()
{
- OUString aBulletChar = m_pBulletPara->GetBulletChar();
+ OUString aBulletChar = m_xBulletPara->GetBulletChar();
return aBulletChar.toChar();
}
@@ -236,7 +232,7 @@ UChar32 LwpSilverBullet::GetBulletChar()
*/
LwpPara* LwpSilverBullet::GetBulletPara()
{
- if (!m_pBulletPara)
+ if (!m_xBulletPara.is())
{
LwpStory* pStory = dynamic_cast<LwpStory*>(m_aStory.obj(VO_STORY).get());
if (!pStory)
@@ -244,10 +240,10 @@ LwpPara* LwpSilverBullet::GetBulletPara()
return NULL;
}
- m_pBulletPara = dynamic_cast<LwpPara*>(pStory->GetFirstPara().obj(VO_PARA).get());
+ m_xBulletPara.set(dynamic_cast<LwpPara*>(pStory->GetFirstPara().obj(VO_PARA).get()));
}
- return m_pBulletPara;
+ return m_xBulletPara.get();
}
/**
@@ -328,10 +324,10 @@ OUString LwpSilverBullet::GetNumCharByStyleID(LwpFribParaNumber* pParaNumber)
*/
bool LwpSilverBullet::IsBulletOrdered()
{
- if (!m_pBulletPara)
+ if (!m_xBulletPara.is())
return false;
- LwpFribPtr& rFribs = m_pBulletPara->GetFribs();
+ LwpFribPtr& rFribs = m_xBulletPara->GetFribs();
return (rFribs.HasFrib(FRIB_TAG_PARANUMBER) != NULL);
}
@@ -374,7 +370,7 @@ OUString LwpSilverBullet::GetAdditionalName(sal_uInt8 nPos)
bool bDivisionName = false;
bool bSectionName = false;
- LwpFrib* pParaFrib = m_pBulletPara->GetFribs().GetFribs();
+ LwpFrib* pParaFrib = m_xBulletPara->GetFribs().GetFribs();
if (!pParaFrib)
{
return aEmpty;
diff --git a/lotuswordpro/source/filter/lwpsilverbullet.hxx b/lotuswordpro/source/filter/lwpsilverbullet.hxx
index c56f35e..c8fbcde 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.hxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.hxx
@@ -142,7 +142,7 @@ private:
sal_uInt32 m_nUseCount;
LwpAtomHolder* m_pAtomHolder;
- LwpPara* m_pBulletPara;
+ rtl::Reference<LwpPara> m_xBulletPara;
OUString m_strStyleName;
sal_uInt16 m_pHideLevels[10];
@@ -167,7 +167,7 @@ inline OUString LwpSilverBullet::GetNumberingName()
}
inline LwpPara* LwpSilverBullet::GetNumberingPara()
{
- return m_pBulletPara;
+ return m_xBulletPara.get();
}
inline bool LwpSilverBullet::IsPosCumulative(sal_uInt16 nHideLevels)
{
More information about the Libreoffice-commits
mailing list