[Libreoffice-commits] core.git: 2 commits - sc/inc sc/qa sc/source sd/qa
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Sep 14 09:21:44 UTC 2020
sc/inc/rangenam.hxx | 2 +-
sc/qa/unit/ucalc.cxx | 8 ++++----
sc/source/core/tool/rangenam.cxx | 6 +++---
sc/source/filter/rtf/eeimpars.cxx | 2 +-
sd/qa/unit/data/odp/tdf133502.odp |binary
sd/qa/unit/export-tests-ooxml2.cxx | 17 +++++++++++++++++
6 files changed, 26 insertions(+), 9 deletions(-)
New commits:
commit 61252edf7ebe2801f39b42c43900c6861ebfd04a
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Sep 13 20:41:32 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Sep 14 11:20:58 2020 +0200
ScRangeData ctor variant always dereferences its ScDocument* arg
Change-Id: I67c344bfd14e55992a9ae07099e2d58bb99c4d3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102621
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx
index 6e19873f63d7..36c31aea33ed 100644
--- a/sc/inc/rangenam.hxx
+++ b/sc/inc/rangenam.hxx
@@ -94,7 +94,7 @@ public:
const ScTokenArray& rArr,
const ScAddress& rAdr = ScAddress(),
Type nType = Type::Name );
- SC_DLLPUBLIC ScRangeData( ScDocument* pDoc,
+ SC_DLLPUBLIC ScRangeData( ScDocument& rDoc,
const OUString& rName,
const ScAddress& rTarget );
// rTarget is ABSPOS jump label
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index fa0bb5cdc0e5..d407efaff99a 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1606,7 +1606,7 @@ void Test::testNamedRange()
}
// Test using another-sheet-local name, scope Sheet1.
- ScRangeData* pLocal1 = new ScRangeData( m_pDoc, "local1", ScAddress(0,0,0));
+ ScRangeData* pLocal1 = new ScRangeData( *m_pDoc, "local1", ScAddress(0,0,0));
ScRangeData* pLocal2 = new ScRangeData( m_pDoc, "local2", "$Sheet1.$A$1");
ScRangeData* pLocal3 = new ScRangeData( m_pDoc, "local3", "Sheet1.$A$1");
ScRangeData* pLocal4 = new ScRangeData( m_pDoc, "local4", "$A$1"); // implicit relative sheet reference
@@ -3336,12 +3336,12 @@ void Test::testCopyPaste()
ScAddress aAdr (0, 0, 0);
//create some range names, local and global
- ScRangeData* pLocal1 = new ScRangeData( m_pDoc, "local1", aAdr);
- ScRangeData* pLocal2 = new ScRangeData( m_pDoc, "local2", aAdr);
+ ScRangeData* pLocal1 = new ScRangeData( *m_pDoc, "local1", aAdr);
+ ScRangeData* pLocal2 = new ScRangeData( *m_pDoc, "local2", aAdr);
ScRangeData* pLocal3 = new ScRangeData( m_pDoc, "local3", "$Sheet1.$A$1");
ScRangeData* pLocal4 = new ScRangeData( m_pDoc, "local4", "Sheet1.$A$1");
ScRangeData* pLocal5 = new ScRangeData( m_pDoc, "local5", "$A$1"); // implicit relative sheet reference
- ScRangeData* pGlobal = new ScRangeData( m_pDoc, "global", aAdr);
+ ScRangeData* pGlobal = new ScRangeData( *m_pDoc, "global", aAdr);
const OUString aGlobal2Symbol("$Sheet1.$A$1:$A$23");
ScRangeData* pGlobal2 = new ScRangeData( m_pDoc, "global2", aGlobal2Symbol);
std::unique_ptr<ScRangeName> pGlobalRangeName(new ScRangeName());
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index 44a2bcff7be7..2d739cbab13f 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -98,15 +98,15 @@ ScRangeData::ScRangeData( ScDocument* pDok,
InitCode();
}
-ScRangeData::ScRangeData( ScDocument* pDok,
+ScRangeData::ScRangeData( ScDocument& rDok,
const OUString& rName,
const ScAddress& rTarget ) :
aName ( rName ),
aUpperName ( ScGlobal::getCharClassPtr()->uppercase( rName ) ),
- pCode ( new ScTokenArray(*pDok) ),
+ pCode ( new ScTokenArray(rDok) ),
aPos ( rTarget ),
eType ( Type::Name ),
- pDoc ( pDok ),
+ pDoc ( &rDok ),
eTempGrammar( FormulaGrammar::GRAM_UNSPECIFIED ),
nIndex ( 0 ),
bModified ( false )
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index b2bc46c8ab0c..46bc08a34e77 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -412,7 +412,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu
{ // Anchor Name => RangeName
if (!pRangeNames->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(*pE->pName)))
{
- ScRangeData* pData = new ScRangeData( mpDoc, *pE->pName,
+ ScRangeData* pData = new ScRangeData( *mpDoc, *pE->pName,
ScAddress( nCol, nRow, nTab ) );
pRangeNames->insert( pData );
}
commit 66132b519f406acc8838934499311b0a1e0fc4c1
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Sun Sep 13 19:01:50 2020 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Sep 14 11:20:50 2020 +0200
tdf#133502: sd_export_ooxml2: Add unittest
Change-Id: Id1b35adb20950758eff47f43200a6f5feb6f24e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102591
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sd/qa/unit/data/odp/tdf133502.odp b/sd/qa/unit/data/odp/tdf133502.odp
new file mode 100644
index 000000000000..de72673049a9
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf133502.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index a46edd8c72f3..899457e11e4a 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -107,6 +107,7 @@ public:
void testTdf99224();
void testTdf92076();
void testTdf59046();
+ void testTdf133502();
void testTdf105739();
void testPageBitmapWithTransparency();
void testPptmContentType();
@@ -225,6 +226,7 @@ public:
CPPUNIT_TEST(testTdf99224);
CPPUNIT_TEST(testTdf92076);
CPPUNIT_TEST(testTdf59046);
+ CPPUNIT_TEST(testTdf133502);
CPPUNIT_TEST(testTdf105739);
CPPUNIT_TEST(testPageBitmapWithTransparency);
CPPUNIT_TEST(testPptmContentType);
@@ -1009,6 +1011,21 @@ void SdOOXMLExportTest2::testTdf59046()
assertXPath(pXmlDocRels, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", 1);
}
+void SdOOXMLExportTest2::testTdf133502()
+{
+ sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf133502.odp"), ODP);
+ utl::TempFile tempFile;
+ xShell = saveAndReload(xShell.get(), PPTX, &tempFile);
+ xShell->DoClose();
+ xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "ppt/comments/comment1.xml");
+
+ assertXPathContent(pXmlDocRels, "/p:cmLst/p:cm/p:text", "Test for creator-initials");
+
+ // Without the fix in place, the comment position would have been 0,0
+ assertXPath(pXmlDocRels, "/p:cmLst/p:cm/p:pos", "x", "2032");
+ assertXPath(pXmlDocRels, "/p:cmLst/p:cm/p:pos", "y", "1029");
+}
+
void SdOOXMLExportTest2::testTdf105739()
{
// Gradient was lost during saving to ODP
More information about the Libreoffice-commits
mailing list