[PATCH 1/7] Changing return types from Reference< XNamedRange > to ScRangeData

Daniel Bankston daniel.dev.libreoffice at gmail.com
Fri Apr 6 08:18:44 PDT 2012


---
 sc/source/filter/inc/workbookhelper.hxx |   18 ++++++++++++++----
 sc/source/filter/oox/workbookhelper.cxx |   20 ++++++++++++--------
 2 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx
index 7a52984..5e94b55 100644
--- a/sc/source/filter/inc/workbookhelper.hxx
+++ b/sc/source/filter/inc/workbookhelper.hxx
@@ -183,8 +183,13 @@ public:
     /** Creates and returns a defined name on-the-fly in the Calc document.
         The name will not be buffered in the global defined names buffer.
         @param orName  (in/out-parameter) Returns the resulting used name. */
-    ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRange >
-                        createNamedRangeObject(
+    //~ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRange >
+                        //~ createNamedRangeObject(
+                            //~ ::rtl::OUString& orName,
+                            //~ const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken>& rTokens,
+                            //~ sal_Int32 nIndex,
+                            //~ sal_Int32 nNameFlags = 0 ) const;
+    ScRangeData createNamedRangeObject(
                             ::rtl::OUString& orName,
                             const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken>& rTokens,
                             sal_Int32 nIndex,
@@ -193,8 +198,13 @@ public:
     /** Creates and returns a defined name on-the-fly in the sheet.
         The name will not be buffered in the global defined names buffer.
         @param orName  (in/out-parameter) Returns the resulting used name. */
-    ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRange >
-                        createLocalNamedRangeObject(
+    //~ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRange >
+                        //~ createLocalNamedRangeObject(
+                            //~ ::rtl::OUString& orName,
+                            //~ const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken>& rTokens,
+                            //~ sal_Int32 nIndex,
+                            //~ sal_Int32 nNameFlags = 0, sal_Int32 nTab = -1 ) const;
+    ScRangeData createLocalNamedRangeObject(
                             ::rtl::OUString& orName,
                             const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken>& rTokens,
                             sal_Int32 nIndex,
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 5a872c2..eae64ad 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -378,7 +378,8 @@ void lcl_addNewByNameAndTokens( ScDocument& rDoc, ScRangeName* pNames, const OUS
         throw RuntimeException();
 }
 
-Reference< XNamedRange > WorkbookGlobals::createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const
+//~ Reference< XNamedRange > WorkbookGlobals::createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const
+ScRangeData WorkbookGlobals::createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const
 {
     // create the name and insert it into the Calc document
     Reference< XNamedRange > xNamedRange;
@@ -393,16 +394,18 @@ Reference< XNamedRange > WorkbookGlobals::createNamedRangeObject( OUString& orNa
         ScDocument& rDoc =  getScDocument();
         ScRangeName* pNames = rDoc.GetRangeName();
         lcl_addNewByNameAndTokens( rDoc, pNames, orName, rTokens, nIndex, nNameFlags );
-        xNamedRange.set( xNamedRanges->getByName( orName ), UNO_QUERY );
+        //~ xNamedRange.set( xNamedRanges->getByName( orName ), UNO_QUERY );
     }
     catch( Exception& )
     {
     }
-    OSL_ENSURE( xNamedRange.is(), "WorkbookGlobals::createNamedRangeObject - cannot create defined name" );
-    return xNamedRange;
+    //~ OSL_ENSURE( xNamedRange.is(), "WorkbookGlobals::createNamedRangeObject - cannot create defined name" );
+    //~ return xNamedRange;
+    return pNames;
 }
 
-Reference< XNamedRange > WorkbookGlobals::createLocalNamedRangeObject( OUString& orName, const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken>&  rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab ) const
+//~ Reference< XNamedRange > WorkbookGlobals::createLocalNamedRangeObject( OUString& orName, const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken>&  rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab ) const
+ScRangeData WorkbookGlobals::createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken>&  rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab ) const
 {
     // create the name and insert it into the Calc document
     Reference< XNamedRange > xNamedRange;
@@ -421,13 +424,14 @@ Reference< XNamedRange > WorkbookGlobals::createLocalNamedRangeObject( OUString&
         ScDocument& rDoc =  getScDocument();
         ScRangeName* pNames = rDoc.GetRangeName( nTab );
         lcl_addNewByNameAndTokens( rDoc, pNames, orName, rTokens, nIndex, nNameFlags );
-        xNamedRange.set( xNamedRanges->getByName( orName ), UNO_QUERY );
+        //~ xNamedRange.set( xNamedRanges->getByName( orName ), UNO_QUERY );
     }
     catch( Exception& )
     {
     }
-    OSL_ENSURE( xNamedRange.is(), "WorkbookGlobals::createLocalNamedRangeObject - cannot create defined name" );
-    return xNamedRange;
+    //~ OSL_ENSURE( xNamedRange.is(), "WorkbookGlobals::createLocalNamedRangeObject - cannot create defined name" );
+    //~ return xNamedRange;
+    return pNames;
 }
 
 Reference< XDatabaseRange > WorkbookGlobals::createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const
-- 
1.7.1


--------------030003000301040704050906
Content-Type: text/x-patch;
 name="0002-More-return-type-changes-core.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0002-More-return-type-changes-core.patch"



More information about the LibreOffice mailing list