diff options
author | Jacek Fraczek <fraczek.jacek@gmail.com> | 2016-10-05 22:00:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-10-10 08:48:30 +0000 |
commit | f004aa99514d385f3ee254bba735f5eaeb7d9ad8 (patch) | |
tree | aacd5792f553b8e9cbf029cc7e0797ed0dd423fe /sd | |
parent | 728c7327bd97602a38723553ed044ea4c01d13b2 (diff) |
tdf#89307: Removed SvRef::operator T*()
Conditional statements are using SvRef::Is() method.
Changed static_cast<T*>(svRef<T>) occurances to svRef.get().
Added operator == and != to SvRef.
SbxObject::Execute is using SbxVariableRef internally.
SbxObject::FindQualified is using SbxVariableRef internally.
Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395
Reviewed-on: https://gerrit.libreoffice.org/29621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/HtmlExportTest.cxx | 2 | ||||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 46 | ||||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 42 | ||||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 14 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 2 | ||||
-rw-r--r-- | sd/source/core/drawdoc.cxx | 2 | ||||
-rw-r--r-- | sd/source/filter/eppt/eppt.cxx | 6 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 2 | ||||
-rw-r--r-- | sd/source/filter/ppt/propread.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/app/sdxfer.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/ViewClipboard.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 4 |
14 files changed, 68 insertions, 68 deletions
diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx index 976f3dbf2e2a..70407bc60ec6 100644 --- a/sd/qa/unit/HtmlExportTest.cxx +++ b/sd/qa/unit/HtmlExportTest.cxx @@ -23,7 +23,7 @@ private: OUString aExt = "." + OUString::createFromAscii(pFormat->pName); utl::TempFile aTempFile(OUString(), true, &aExt); aTempFile.EnableKillingFile(); - exportTo(xDocShRef, pFormat, aTempFile); + exportTo(xDocShRef.get(), pFormat, aTempFile); return parseHtml(aTempFile); } diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 402f03b254b3..db2d760065af 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -187,7 +187,7 @@ void checkFontAttributes( const SdrTextObj* pObj, ItemValue nVal) void SdOOXMLExportTest1::testBnc870233_1() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bnc870233_1.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); @@ -213,7 +213,7 @@ void SdOOXMLExportTest1::testBnc870233_1() void SdOOXMLExportTest1::testBnc870233_2() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bnc870233_2.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); @@ -245,7 +245,7 @@ void SdOOXMLExportTest1::testN828390_4() bool bPassed = false; ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/n828390_4.odp"), ODP ); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); { @@ -280,7 +280,7 @@ void SdOOXMLExportTest1::testN828390_5() { ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/n828390_5.odp"), ODP ); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); { @@ -300,7 +300,7 @@ void SdOOXMLExportTest1::testFdo71961() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/fdo71961.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); // Export to .pptx changes all text frames to custom shape objects, which obey TextWordWrap property @@ -328,7 +328,7 @@ void SdOOXMLExportTest1::testN828390() bool bPassed = false; ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/n828390.pptx"), PPTX ); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); { @@ -360,7 +360,7 @@ void SdOOXMLExportTest1::testN828390() void SdOOXMLExportTest1::testBnc880763() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bnc880763.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); @@ -381,7 +381,7 @@ void SdOOXMLExportTest1::testBnc880763() void SdOOXMLExportTest1::testBnc862510_5() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bnc862510_5.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); @@ -402,7 +402,7 @@ void SdOOXMLExportTest1::testBnc862510_5() void SdOOXMLExportTest1::testBnc822347_EmptyBullet() { sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/bnc822347_EmptyBullet.odp"), ODP); - xDocShRef = saveAndReload(xDocShRef, PPTX); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX); SdDrawDocument* pDoc = xDocShRef->GetDoc(); SdrOutliner* pOutliner = pDoc->GetInternalOutliner(); @@ -431,7 +431,7 @@ void SdOOXMLExportTest1::testBnc822347_EmptyBullet() void SdOOXMLExportTest1::testFdo90607() { sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/fdo90607.pptx"), PPTX); - xDocShRef = saveAndReload(xDocShRef, PPTX); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(1) ); @@ -445,7 +445,7 @@ void SdOOXMLExportTest1::testFdo90607() void SdOOXMLExportTest1::testFdo83751() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/fdo83751.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); SdDrawDocument *pDoc = xDocShRef->GetDoc(); CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != nullptr ); @@ -462,7 +462,7 @@ void SdOOXMLExportTest1::testFdo83751() void SdOOXMLExportTest1::testFdo79731() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/fdo79731.odp"), ODP); - xDocShRef = saveAndReload(xDocShRef, PPTX); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); SdDrawDocument *pDoc = xDocShRef->GetDoc(); CPPUNIT_ASSERT(pDoc); xDocShRef->DoClose(); @@ -520,7 +520,7 @@ void SdOOXMLExportTest1::testTableCellFillProperties() void SdOOXMLExportTest1::testBulletStartNumber() { ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/n90255.pptx"), PPTX ); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pPage->GetObj(0) ); @@ -535,7 +535,7 @@ void SdOOXMLExportTest1::testBulletStartNumber() void SdOOXMLExportTest1::testLineStyle() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/lineStyle.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); SdrObject const* pShape = pPage->GetObj(0); @@ -552,7 +552,7 @@ void SdOOXMLExportTest1::testRightToLeftParaghraph() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/rightToLeftParagraph.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); // Get first paragraph @@ -570,7 +570,7 @@ void SdOOXMLExportTest1::testTextboxWithHyperlink() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/hyperlinktest.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); // Get first paragraph @@ -596,7 +596,7 @@ void SdOOXMLExportTest1::testBulletColor() { ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bulletColor.pptx"), PPTX ); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); @@ -614,7 +614,7 @@ void SdOOXMLExportTest1::testBulletColor() void SdOOXMLExportTest1::testBulletCharAndFont() { ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/bulletCharAndFont.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) ); @@ -642,7 +642,7 @@ void SdOOXMLExportTest1::testBulletCharAndFont() void SdOOXMLExportTest1::testBulletMarginAndIndentation() { ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bulletMarginAndIndent.pptx"), PPTX ); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); @@ -663,7 +663,7 @@ void SdOOXMLExportTest1::testParaMarginAndindentation() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/paraMarginAndIndentation.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); // Get first paragraph @@ -684,7 +684,7 @@ void SdOOXMLExportTest1::testParaMarginAndindentation() void SdOOXMLExportTest1::testCellLeftAndRightMargin() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/n90223.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); sal_Int32 nLeftMargin, nRightMargin; const SdrPage *pPage = GetPage( 1, xDocShRef ); @@ -715,7 +715,7 @@ void SdOOXMLExportTest1::testCellLeftAndRightMargin() void SdOOXMLExportTest1::testMergedCells() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/cellspan.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0)); @@ -732,7 +732,7 @@ void SdOOXMLExportTest1::testMergedCells() void SdOOXMLExportTest1::testTableCellBorder() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/n90190.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); const SdrPage *pPage = GetPage( 1, xDocShRef ); diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index fdf5d0453460..4bc7585d9b3d 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -161,7 +161,7 @@ public: void SdOOXMLExportTest2::testTdf93883() { ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf93883.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) ); uno::Reference< beans::XPropertySet > xPropSet( xParagraph, uno::UNO_QUERY_THROW ); @@ -175,7 +175,7 @@ void SdOOXMLExportTest2::testBnc822341() // Check import / export of embedded text document ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/bnc822341.odp"), ODP); utl::TempFile tempFile1; - xDocShRef = saveAndReload( xDocShRef, PPTX, &tempFile1 ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile1 ); // Export an LO specific ole object (imported from an ODP document) { @@ -197,7 +197,7 @@ void SdOOXMLExportTest2::testBnc822341() "progId", "Word.Document.12"); - const SdrPage *pPage = GetPage( 1, xDocShRef ); + const SdrPage *pPage = GetPage( 1, xDocShRef.get() ); const SdrObject* pObj = dynamic_cast<SdrObject*>( pPage->GetObj(0) ); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); @@ -205,7 +205,7 @@ void SdOOXMLExportTest2::testBnc822341() } utl::TempFile tempFile2; - xDocShRef = saveAndReload( xDocShRef, PPTX, &tempFile2 ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile2 ); // Export an MS specific ole object (imported from a PPTX document) { @@ -246,7 +246,7 @@ void SdOOXMLExportTest2::testMathObject() // Check import / export of math object ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/math.odp"), ODP); utl::TempFile tempFile1; - xDocShRef = saveAndReload(xDocShRef, PPTX, &tempFile1); + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile1); // Export an LO specific ole object (imported from an ODP document) { @@ -266,7 +266,7 @@ void SdOOXMLExportTest2::testMathObject() } utl::TempFile tempFile2; - xDocShRef = saveAndReload( xDocShRef, PPTX, &tempFile2 ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile2 ); // Export an MS specific ole object (imported from a PPTX document) { @@ -293,7 +293,7 @@ void SdOOXMLExportTest2::testMathObjectPPT2010() // Check import / export of math object ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/Math.pptx"), PPTX); utl::TempFile tempFile1; - xDocShRef = saveAndReload(xDocShRef, PPTX, &tempFile1); + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile1); // Export an MS specific ole object (imported from a PPTX document) { @@ -318,7 +318,7 @@ void SdOOXMLExportTest2::testMathObjectPPT2010() void SdOOXMLExportTest2::testTdf80224() { ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf80224.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); uno::Reference<text::XTextRange> const xParagraph( getParagraphFromShape( 0, xShape ) ); @@ -345,7 +345,7 @@ void SdOOXMLExportTest2::testTdf91378() OUString propValue; xUDProps->getPropertyValue("Testing") >>= propValue; CPPUNIT_ASSERT(propValue.isEmpty()); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); } xDocShRef->DoClose(); } @@ -394,7 +394,7 @@ bool checkTransitionOnPage(uno::Reference<drawing::XDrawPagesSupplier> const & x void SdOOXMLExportTest2::testExportTransitionsPPTX() { sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/AllTransitions.odp"), ODP); - xDocShRef = saveAndReload(xDocShRef, PPTX); + xDocShRef = saveAndReload(xDocShRef.get(), PPTX); uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW); // WIPE TRANSITIONS @@ -499,7 +499,7 @@ void SdOOXMLExportTest2::testPresetShapesExport() }; utl::TempFile tempFile; - xDocShRef = saveAndReload( xDocShRef, PPTX, &tempFile ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile ); xmlDocPtr pXmlDocCT = parseExport(tempFile, "ppt/slides/slide1.xml"); const OString sPattern( "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom[@prst='_T_']/a:avLst/a:gd[_N_]" ); @@ -539,7 +539,7 @@ void SdOOXMLExportTest2::testTdf92527() uno::Reference<beans::XPropertySet> xPropertySet1(xShape1, uno::UNO_QUERY); xPropertySet1->setPropertyValue("CustomShapeGeometry", uno::makeAny(aShapeGeometry)); - xDocShRef = saveAndReload(xDocShRef, PPTX); + xDocShRef = saveAndReload(xDocShRef.get(), PPTX); uno::Reference<drawing::XDrawPagesSupplier> xDoc2(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW); uno::Reference<drawing::XDrawPage> xPage2(xDoc2->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW); @@ -605,7 +605,7 @@ void SdOOXMLExportTest2::testDatetimeFieldNumberFormat() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/numfmt.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); for(sal_uInt16 i = 0; i <= 6; ++i) { @@ -619,7 +619,7 @@ void SdOOXMLExportTest2::testDatetimeFieldNumberFormatPPTX() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/numfmt.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); for(sal_uInt16 i = 0; i <= 6; ++i) { @@ -633,7 +633,7 @@ void SdOOXMLExportTest2::testSlideNumberField() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/slidenum_field.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() ); @@ -645,7 +645,7 @@ void SdOOXMLExportTest2::testSlideNumberFieldPPTX() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/slidenum_field.pptx"), PPTX); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() ); @@ -657,7 +657,7 @@ void SdOOXMLExportTest2::testSlideCountField() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/slidecount_field.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() ); @@ -669,7 +669,7 @@ void SdOOXMLExportTest2::testSlideNameField() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/slidename_field.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() ); @@ -681,7 +681,7 @@ void SdOOXMLExportTest2::testExtFileField() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/extfile_field.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); for(sal_uInt16 i = 0; i <= 3; ++i) { @@ -714,7 +714,7 @@ void SdOOXMLExportTest2::testAuthorField() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/author_field.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, PPTX ); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); uno::Reference< text::XTextField > xField = getTextFieldFromPage(0, 0, 0, 0, xDocShRef); CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is() ); @@ -725,7 +725,7 @@ void SdOOXMLExportTest2::testAuthorField() void SdOOXMLExportTest2::testTdf99224() { sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf99224.odp"), ODP); - xShell = saveAndReload(xShell, PPTX); + xShell = saveAndReload(xShell.get(), PPTX); uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell); // This was 0: the image with text was lost on export. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xPage->getCount()); diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 5ecb651313d9..014720e1f7d6 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -141,7 +141,7 @@ void SdExportTest::testN821567() OUString bgImage; ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/n821567.pptx"), PPTX ); - xDocShRef = saveAndReload( xDocShRef, ODP ); + xDocShRef = saveAndReload( xDocShRef.get(), ODP ); uno::Reference< drawing::XDrawPagesSupplier > xDoc( xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW ); CPPUNIT_ASSERT_MESSAGE( "not exactly one page", xDoc->getDrawPages()->getCount() == 1 ); @@ -185,7 +185,7 @@ void checkFontAttributes( const SdrTextObj* pObj, ItemValue nVal) void SdExportTest::testTransparentBackground() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/transparent_background.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, ODP ); + xDocShRef = saveAndReload( xDocShRef.get(), ODP ); const SdrPage *pPage = GetPage( 1, xDocShRef ); @@ -206,7 +206,7 @@ void SdExportTest::testMediaEmbedding() ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/media_embedding.odp"), ODP); #if HAVE_FEATURE_GLTF - xDocShRef = saveAndReload( xDocShRef, ODP ); + xDocShRef = saveAndReload( xDocShRef.get(), ODP ); #endif const SdrPage *pPage = GetPage( 1, xDocShRef ); @@ -236,7 +236,7 @@ void SdExportTest::testMediaEmbedding() void SdExportTest::testFdo84043() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/fdo84043.odp"), ODP); - xDocShRef = saveAndReload( xDocShRef, ODP ); + xDocShRef = saveAndReload( xDocShRef.get(), ODP ); // the bug was duplicate attributes, causing crash in a build with asserts const SdrPage *pPage = GetPage( 1, xDocShRef ); @@ -356,7 +356,7 @@ void SdExportTest::testTdf80020() uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName("graphics"), uno::UNO_QUERY); uno::Reference<style::XStyle> xStyle(xStyleFamily->getByName("Test Style"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("text"), xStyle->getParentStyle()); - xDocShRef = saveAndReload( xDocShRef, ODP ); + xDocShRef = saveAndReload( xDocShRef.get(), ODP ); } uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xDocShRef->GetModel(), uno::UNO_QUERY); uno::Reference<container::XNameAccess> xStyleFamilies(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY); @@ -516,7 +516,7 @@ void SdExportTest::testTdf62176() CPPUNIT_ASSERT_EQUAL(OUString("Hello World"), xParagraph->getString()); //Saving and Reloading the file - xDocShRef = saveAndReload(xDocShRef, ODP); + xDocShRef = saveAndReload( xDocShRef.get(), ODP ); uno::Reference<drawing::XDrawPage> xPage2( getPage(0, xDocShRef ) ); //there should be only *one* shape CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xPage2->getCount()); @@ -542,7 +542,7 @@ void SdExportTest::testEmbeddedPdf() { #if HAVE_FEATURE_PDFIMPORT sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/embedded-pdf.odp"), ODP); - xShell = saveAndReload(xShell, ODP); + xShell = saveAndReload( xShell.get(), ODP ); uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell); uno::Reference<beans::XPropertySet> xShape(xPage->getByIndex(0), uno::UNO_QUERY); OUString aReplacementGraphicURL; diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index fb5c5e67540e..c85fda8f5cfe 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -237,7 +237,7 @@ void SdImportTest::testDocumentLayout() sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc( "/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pInput ), aFilesToCompare[i].nFormat ); if( aFilesToCompare[i].nExportType >= 0 ) - xDocShRef = saveAndReload( xDocShRef, aFilesToCompare[i].nExportType ); + xDocShRef = saveAndReload( xDocShRef.get(), aFilesToCompare[i].nExportType ); compareWithShapesDump( xDocShRef, m_directories.getPathFromSrc( "/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pDump ), i == nUpdateMe ); diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 6726f3736d9e..4a061d0b133b 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -483,7 +483,7 @@ SdDrawDocument* SdDrawDocument::AllocSdDrawDocument() const mpCreatingTransferable->SetDocShell( new ::sd::GraphicDocShell( SfxObjectCreateMode::EMBEDDED, true, meDocType ) ); - pNewDocSh = static_cast< ::sd::DrawDocShell*>( pObj = mpCreatingTransferable->GetDocShell() ); + pNewDocSh = static_cast< ::sd::DrawDocShell*>( pObj = mpCreatingTransferable->GetDocShell().get() ); pNewDocSh->DoInitNew(); pNewModel = pNewDocSh->GetDoc(); diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 8d6cf4d51988..96556e6280a7 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -531,12 +531,12 @@ bool PPTWriter::ImplCreateDocumentSummaryInformation() { aThumbSeq = *o3tl::doAccess<uno::Sequence<sal_Int8>>(mAny); } - sfx2::SaveOlePropertySet( xDocProps, mrStg, + sfx2::SaveOlePropertySet( xDocProps, mrStg.get(), &aThumbSeq, &aGuidSeq, &aHyperSeq); } else { - sfx2::SaveOlePropertySet( xDocProps, mrStg, + sfx2::SaveOlePropertySet( xDocProps, mrStg.get(), nullptr, &aGuidSeq, &aHyperSeq ); } } @@ -1268,7 +1268,7 @@ void PPTWriter::ImplWriteOLE( ) OUString aPersistStream( SVEXT_PERSIST_STREAM ); SvMemoryStream aStream; tools::SvRef<SotStorage> xCleanStorage( new SotStorage( false, aStream ) ); - xTempStorage->CopyTo( xCleanStorage ); + xTempStorage->CopyTo( xCleanStorage.get() ); // create a dummy content stream, the dummy content is necessary for ppt, but not for // doc files, so we can't share code. tools::SvRef<SotStorageStream> xStm = xCleanStorage->OpenSotStream( aPersistStream ); diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index b58e1cbc9bfc..bd7ce099cce7 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2762,7 +2762,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportPPT(const OUString &rURL return false; tools::SvRef<SotStorageStream> xDocStream(xStorage->OpenSotStream( "PowerPoint Document", StreamMode::STD_READ)); - if (!xDocStream) + if ( !xDocStream.Is() ) return false; SdDLL::Init(); diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx index f91888b08fc8..49bb5e5fb43e 100644 --- a/sd/source/filter/ppt/propread.cxx +++ b/sd/source/filter/ppt/propread.cxx @@ -553,7 +553,7 @@ PropRead::PropRead( SotStorage& rStorage, const OUString& rName ) : if ( rStorage.IsStream( rName ) ) { mpSvStream = rStorage.OpenSotStream( rName, StreamMode::STD_READ ); - if ( mpSvStream ) + if ( mpSvStream.Is() ) { mpSvStream->SetEndian( SvStreamEndian::LITTLE ); memset( mApplicationCLSID, 0, 16 ); @@ -604,7 +604,7 @@ void PropRead::Read() nCurrent = mpSvStream->Tell(); mpSvStream->Seek( nSectionOfs ); Section aSection( pSectCLSID ); - aSection.Read( mpSvStream ); + aSection.Read( mpSvStream.get() ); AddSection( aSection ); mpSvStream->Seek( nCurrent ); } diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index c699a563fcd7..a92573d7739b 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -127,7 +127,7 @@ SdTransferable::~SdTransferable() if( maDocShellRef.Is() ) { - SfxObjectShell* pObj = maDocShellRef; + SfxObjectShell* pObj = maDocShellRef.get(); ::sd::DrawDocShell* pDocSh = static_cast< ::sd::DrawDocShell*>(pObj); pDocSh->DoClose(); } diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index a926f04434d8..4dec3b3e5808 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -325,7 +325,7 @@ sal_Int32 Clipboard::PasteTransferable (sal_Int32 nInsertPosition) } else { - SfxObjectShell* pShell = pClipTransferable->GetDocShell(); + SfxObjectShell* pShell = pClipTransferable->GetDocShell().get(); DrawDocShell* pDataDocSh = static_cast<DrawDocShell*>(pShell); SdDrawDocument* pDataDoc = pDataDocSh->GetDoc(); diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index b297daad4693..e65729257426 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -358,7 +358,7 @@ void SlotManager::FuSupport (SfxRequest& rRequest) SdTransferable* pTransferClip = SD_MOD()->pTransferClip; if( pTransferClip ) { - SfxObjectShell* pTransferDocShell = pTransferClip->GetDocShell(); + SfxObjectShell* pTransferDocShell = pTransferClip->GetDocShell().get(); DrawDocShell* pDocShell = dynamic_cast<DrawDocShell*>(pTransferDocShell); if (pDocShell && pDocShell->GetDoc()->GetPageCount() > 1) @@ -698,14 +698,14 @@ void SlotManager::GetClipboardState ( SfxItemSet& rSet) || rSet.GetItemState(SID_PASTE_SPECIAL) == SfxItemState::DEFAULT) { // no own clipboard data? - if ( !pTransferClip || !pTransferClip->GetDocShell() ) + if ( !pTransferClip || !pTransferClip->GetDocShell().Is() ) { rSet.DisableItem(SID_PASTE); rSet.DisableItem(SID_PASTE_SPECIAL); } else { - SfxObjectShell* pTransferDocShell = pTransferClip->GetDocShell(); + SfxObjectShell* pTransferDocShell = pTransferClip->GetDocShell().get(); if( !pTransferDocShell || static_cast<DrawDocShell*>(pTransferDocShell)->GetDoc()->GetPageCount() <= 1 ) { diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx index d6fd07e9cb16..ef088734f3c8 100644 --- a/sd/source/ui/view/ViewClipboard.cxx +++ b/sd/source/ui/view/ViewClipboard.cxx @@ -200,7 +200,7 @@ sal_uInt16 ViewClipboard::InsertSlides ( { // Otherwise all pages of the document of the transferable are // inserted. - SfxObjectShell* pShell = rTransferable.GetDocShell(); + SfxObjectShell* pShell = rTransferable.GetDocShell().get(); pDataDocSh = static_cast<DrawDocShell*>(pShell); SdDrawDocument* pDataDoc = pDataDocSh->GetDoc(); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 452a7e4bc5da..e15d320cc6f2 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -363,7 +363,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // Paste only if SfxClassificationHelper recommends so. const SfxObjectShellRef& pSource = pOwnData->GetDocShell(); SfxObjectShell* pDestination = mrDoc.GetDocSh(); - if (pSource && pDestination) + if (pSource.Is() && pDestination) { SfxClassificationCheckPasteResult eResult = SfxClassificationHelper::CheckPaste(pSource->getDocProperties(), pDestination->getDocProperties()); if (!SfxClassificationHelper::ShowPasteInfo(eResult)) @@ -375,7 +375,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, { const View* pSourceView = pOwnData->GetView(); - if( pOwnData->GetDocShell() && pOwnData->IsPageTransferable() ) + if( pOwnData->GetDocShell().Is() && pOwnData->IsPageTransferable() ) { mpClipboard->HandlePageDrop (*pOwnData); bReturn = true; |