You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by le...@apache.org on 2012/09/07 04:50:24 UTC

svn commit: r1381844 - in /incubator/ooo/trunk/main: binfilter/bf_sc/source/ui/unoobj/ binfilter/inc/bf_sc/ offapi/com/sun/star/sheet/ offapi/type_reference/ oox/inc/oox/xls/ oox/source/token/ oox/source/xls/ sc/inc/ sc/source/filter/xml/ sc/source/ui/...

Author: leiw
Date: Fri Sep  7 02:50:23 2012
New Revision: 1381844

URL: http://svn.apache.org/viewvc?rev=1381844&view=rev
Log:
#i120478 Enhancement request: support sheet scoped named ranges in Calc
Some modification
1)Adding two new interface instead of adding new member functions to existed interface
2)roll back types.rdb
3)roll back temp fix for binfilter

          Patch by: zhaoshzh (Zhao Shao Zhi)
          Review by: Wang Lei

Added:
    incubator/ooo/trunk/main/offapi/com/sun/star/sheet/RangeScopeName.idl
    incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRange2.idl
    incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRanges2.idl
Modified:
    incubator/ooo/trunk/main/binfilter/bf_sc/source/ui/unoobj/sc_nameuno.cxx
    incubator/ooo/trunk/main/binfilter/inc/bf_sc/nameuno.hxx
    incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRange.idl
    incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRanges.idl
    incubator/ooo/trunk/main/offapi/com/sun/star/sheet/makefile.mk
    incubator/ooo/trunk/main/offapi/type_reference/types.rdb
    incubator/ooo/trunk/main/oox/inc/oox/xls/defnamesbuffer.hxx
    incubator/ooo/trunk/main/oox/inc/oox/xls/workbookhelper.hxx
    incubator/ooo/trunk/main/oox/source/token/properties.txt
    incubator/ooo/trunk/main/oox/source/xls/sheetdatabuffer.cxx
    incubator/ooo/trunk/main/oox/source/xls/workbookhelper.cxx
    incubator/ooo/trunk/main/sc/inc/nameuno.hxx
    incubator/ooo/trunk/main/sc/inc/unonames.hxx
    incubator/ooo/trunk/main/sc/source/filter/xml/xmlexprt.cxx
    incubator/ooo/trunk/main/sc/source/filter/xml/xmlimprt.cxx
    incubator/ooo/trunk/main/sc/source/ui/unoobj/docuno.cxx
    incubator/ooo/trunk/main/sc/source/ui/unoobj/nameuno.cxx

Modified: incubator/ooo/trunk/main/binfilter/bf_sc/source/ui/unoobj/sc_nameuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/binfilter/bf_sc/source/ui/unoobj/sc_nameuno.cxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/binfilter/bf_sc/source/ui/unoobj/sc_nameuno.cxx (original)
+++ incubator/ooo/trunk/main/binfilter/bf_sc/source/ui/unoobj/sc_nameuno.cxx Fri Sep  7 02:50:23 2012
@@ -270,21 +270,6 @@ void SAL_CALL ScNamedRangeObj::setType( 
 	Modify_Impl( NULL, NULL, NULL, &nNewType );
 }
 
-
-::rtl::OUString SAL_CALL ScNamedRangeObj::getScopeName( )
-    throw (::com::sun::star::uno::RuntimeException)
-{
-    return rtl::OUString();
-}
-
-void SAL_CALL ScNamedRangeObj::setScopeAndRangeName(
-    const ::rtl::OUString& /*aScopeName*/,
-    const ::rtl::OUString& /*aRangeName*/ )
-        throw (::com::sun::star::uno::RuntimeException)
-{
-}
-
-
 // XCellRangeSource
 
 uno::Reference<table::XCellRange> SAL_CALL ScNamedRangeObj::getReferredCells()
@@ -535,48 +520,6 @@ void SAL_CALL ScNamedRangesObj::outputLi
 	}
 }
 
-
-void SAL_CALL ScNamedRangesObj::addNewByScopeName(
-    const ::rtl::OUString& /*aScopeName*/,
-    const ::rtl::OUString& /*aRangeName*/,
-    const ::rtl::OUString& /*aContent*/,
-    const ::com::sun::star::table::CellAddress& aPosition, ::sal_Int32 /*nType*/ )
-        throw (::com::sun::star::uno::RuntimeException)
-{
-}
-
-void SAL_CALL ScNamedRangesObj::removeByScopeName(
-    const ::rtl::OUString& /*aScopeName*/,
-    const ::rtl::OUString& /*aRangeName*/ )
-        throw (::com::sun::star::uno::RuntimeException)
-{
-
-}
-
-::sal_Bool SAL_CALL ScNamedRangesObj::hasByScopeName(
-    const ::rtl::OUString& /*aScopeName*/,
-    const ::rtl::OUString& /*aRangeName*/ )
-        throw (::com::sun::star::uno::RuntimeException)
-{
-    return sal_False;
-}
-
-::com::sun::star::uno::Any SAL_CALL ScNamedRangesObj::getByScopeName(
-    const ::rtl::OUString& /*aScopeName*/,
-    const ::rtl::OUString& /*aRangeName*/ )
-        throw (::com::sun::star::container::NoSuchElementException,
-               ::com::sun::star::lang::WrappedTargetException,
-               ::com::sun::star::uno::RuntimeException)
-{
-    return ::com::sun::star::uno::Any();
-}
-
-::com::sun::star::uno::Sequence< ::com::sun::star::sheet::RangeScopeName > SAL_CALL ScNamedRangesObj::getElementScopeNames(  )
-    throw (::com::sun::star::uno::RuntimeException)
-{
-    return ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::RangeScopeName >();
-}
-
 // container::XEnumerationAccess
 
 uno::Reference<container::XEnumeration> SAL_CALL ScNamedRangesObj::createEnumeration()

Modified: incubator/ooo/trunk/main/binfilter/inc/bf_sc/nameuno.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/binfilter/inc/bf_sc/nameuno.hxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/binfilter/inc/bf_sc/nameuno.hxx (original)
+++ incubator/ooo/trunk/main/binfilter/inc/bf_sc/nameuno.hxx Fri Sep  7 02:50:23 2012
@@ -106,11 +106,6 @@ public:
 	virtual sal_Int32		SAL_CALL getType() throw(::com::sun::star::uno::RuntimeException);
 	virtual void SAL_CALL	setType( sal_Int32 nType ) throw(::com::sun::star::uno::RuntimeException);
 
-    virtual ::rtl::OUString SAL_CALL getScopeName(  ) throw (::com::sun::star::uno::RuntimeException);
-    virtual void SAL_CALL setScopeAndRangeName( const ::rtl::OUString& aScopeName,
-                                                const ::rtl::OUString& aRangeName )
-                                throw (::com::sun::star::uno::RuntimeException);
-
 							// XNamed
 	virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
 	virtual void SAL_CALL	setName( const ::rtl::OUString& aName )
@@ -202,25 +197,6 @@ public:
 	virtual void SAL_CALL	outputList( const ::com::sun::star::table::CellAddress& aOutputPosition )
 								throw(::com::sun::star::uno::RuntimeException);
 
-    virtual void SAL_CALL addNewByScopeName( const ::rtl::OUString& aScopeName,
-                                             const ::rtl::OUString& aRangeName,
-                                             const ::rtl::OUString& aContent,
-                                             const ::com::sun::star::table::CellAddress& aPosition, ::sal_Int32 nType )
-                                throw (::com::sun::star::uno::RuntimeException);
-    virtual void SAL_CALL removeByScopeName( const ::rtl::OUString& aScopeName,
-                                             const ::rtl::OUString& aRangeName )
-                                throw (::com::sun::star::uno::RuntimeException);
-    virtual ::sal_Bool SAL_CALL hasByScopeName( const ::rtl::OUString& aScopeName,
-                                                const ::rtl::OUString& aRangeName )
-                                throw (::com::sun::star::uno::RuntimeException);
-    virtual ::com::sun::star::uno::Any SAL_CALL getByScopeName( const ::rtl::OUString& aScopeName,
-                                                                const ::rtl::OUString& aRangeName )
-                                throw (::com::sun::star::container::NoSuchElementException,
-                                       ::com::sun::star::lang::WrappedTargetException,
-                                       ::com::sun::star::uno::RuntimeException);
-    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::RangeScopeName > SAL_CALL getElementScopeNames(  )
-                                throw (::com::sun::star::uno::RuntimeException);
-
 							// XNameAccess
 	virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
 								throw(::com::sun::star::container::NoSuchElementException,

Added: incubator/ooo/trunk/main/offapi/com/sun/star/sheet/RangeScopeName.idl
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/sheet/RangeScopeName.idl?rev=1381844&view=auto
==============================================================================
--- incubator/ooo/trunk/main/offapi/com/sun/star/sheet/RangeScopeName.idl (added)
+++ incubator/ooo/trunk/main/offapi/com/sun/star/sheet/RangeScopeName.idl Fri Sep  7 02:50:23 2012
@@ -0,0 +1,41 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+#ifndef __com_sun_star_sheet_RangeScopeName_idl__
+#define __com_sun_star_sheet_RangeScopeName_idl__
+
+module com {  module sun {  module star {  module sheet {
+/* provides a structure to store the user defined name ranges with duplicate names
+	*/
+published struct RangeScopeName
+{
+    /** the scope name
+     */
+    string ScopeName;
+
+
+    /** the range name
+     */
+    string RangeName;
+};
+
+}; }; }; };
+
+#endif

Modified: incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRange.idl
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRange.idl?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRange.idl (original)
+++ incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRange.idl Fri Sep  7 02:50:23 2012
@@ -97,9 +97,7 @@ published interface XNamedRange: com::su
 	 */
 	void setType( [in] long nType );
 	
-	string getScopeName();
-	
-	void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );
+
 
 };
 

Added: incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRange2.idl
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRange2.idl?rev=1381844&view=auto
==============================================================================
--- incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRange2.idl (added)
+++ incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRange2.idl Fri Sep  7 02:50:23 2012
@@ -0,0 +1,59 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+
+#ifndef __com_sun_star_sheet_XNamedRange2_idl__
+#define __com_sun_star_sheet_XNamedRange2_idl__
+
+#ifndef __com_sun_star_sheet_XNamedRange_idl__
+#include <com/sun/star/sheet/XNamedRange.idl>
+#endif
+//=============================================================================
+
+module com {  module sun {  module star {  module sheet {
+
+//=============================================================================
+
+/** provides access to the settings of a named ranges with duplicate names in a spreadsheet
+	document.
+
+	@see com::sun::star::sheet::NamedRange2
+ */
+published interface XNamedRange2: com::sun::star::sheet::XNamedRange
+{
+	//-------------------------------------------------------------------------
+
+	//get the name of a scope
+	string getScopeName();
+	
+	//set the scope nanme and it's using name
+	
+	void setScopeAndRangeName( [in] string aScopeName, [in] string aRangeName );
+
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
+

Modified: incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRanges.idl
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRanges.idl?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRanges.idl (original)
+++ incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRanges.idl Fri Sep  7 02:50:23 2012
@@ -45,25 +45,6 @@
 module com {  module sun {  module star {  module sheet {
 
 
-published struct RangeScopeName
-{
-    //-------------------------------------------------------------------------
-
-    /** is the OpCode of the token.
-
-        @see com::sun::star::sheet::XFormulaOpCodeMapper
-     */
-    string ScopeName;
-
-	//-------------------------------------------------------------------------
-
-    /** is additional data in the token, depending on the OpCode.
-
-        @see com::sun::star::sheet::NamedRange::TokenIndex
-        @see com::sun::star::sheet::DatabaseRange::TokenIndex
-     */
-    string RangeName;
-};
 //=============================================================================
 
 /** provides access to the members in a collection of named ranges and to
@@ -148,22 +129,6 @@ published interface XNamedRanges: com::s
 	 */
 	void outputList( [in] com::sun::star::table::CellAddress aOutputPosition );
 	
-	void addNewByScopeName(
-			[in] string aScopeName,
-			[in] string aRangeName,
-			[in] string aContent,
-			[in] com::sun::star::table::CellAddress aPosition,
-			[in] long nType );
-	
-	void removeByScopeName( [in] string aScopeName, [in] string aRangeName );
-	
-	boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );
-	
-	any getByScopeName( [in] string aScopeName, [in] string aRangeName )
-			raises( com::sun::star::container::NoSuchElementException, 
-					com::sun::star::lang::WrappedTargetException ); 
-					
-        sequence<RangeScopeName> getElementScopeNames(); 
 
 };
 

Added: incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRanges2.idl
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRanges2.idl?rev=1381844&view=auto
==============================================================================
--- incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRanges2.idl (added)
+++ incubator/ooo/trunk/main/offapi/com/sun/star/sheet/XNamedRanges2.idl Fri Sep  7 02:50:23 2012
@@ -0,0 +1,76 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+
+#ifndef __com_sun_star_sheet_XNamedRanges2_idl__
+#define __com_sun_star_sheet_XNamedRanges2_idl__
+
+//=============================================================================
+#ifndef __com_sun_star_sheet_XNamedRanges_idl__
+#include <com/sun/star/sheet/XNamedRanges.idl>
+#endif
+
+#ifndef __com_sun_star_sheet_RangeScopeName_idl__
+#include <com/sun/star/sheet/RangeScopeName.idl>
+#endif
+
+module com {  module sun {  module star {  module sheet {
+
+
+
+//=============================================================================
+
+/** provides access to the members in a collection user defined named ranges with duplicate names and to
+	insert and remove them.
+
+	@see com::sun::star::sheet::NamedRanges2
+	@see com::sun::star::sheet::NamedRange2
+ */
+published interface XNamedRanges2: com::sun::star::sheet::XNamedRanges
+{
+	//-------------------------------------------------------------------------
+
+	void addNewByScopeName(
+			[in] string aScopeName,
+			[in] string aRangeName,
+			[in] string aContent,
+			[in] com::sun::star::table::CellAddress aPosition,
+			[in] long nType );
+	
+	void removeByScopeName( [in] string aScopeName, [in] string aRangeName );
+	
+	boolean hasByScopeName( [in] string aScopeName, [in] string aRangeName );
+	
+	any getByScopeName( [in] string aScopeName, [in] string aRangeName )
+			raises( com::sun::star::container::NoSuchElementException, 
+					com::sun::star::lang::WrappedTargetException ); 
+					
+        sequence<com::sun::star::sheet::RangeScopeName> getElementScopeNames(); 
+
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
+

Modified: incubator/ooo/trunk/main/offapi/com/sun/star/sheet/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/com/sun/star/sheet/makefile.mk?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/offapi/com/sun/star/sheet/makefile.mk (original)
+++ incubator/ooo/trunk/main/offapi/com/sun/star/sheet/makefile.mk Fri Sep  7 02:50:23 2012
@@ -288,8 +288,11 @@ IDLFILES=\
 	XMembersSupplier.idl\
 	XMultiFormulaTokens.idl\
 	XMultipleOperation.idl\
+	RangeScopeName.idl\
 	XNamedRange.idl\
 	XNamedRanges.idl\
+	XNamedRange2.idl\
+	XNamedRanges2.idl\
 	XPrintAreas.idl\
 	XRangeSelection.idl\
 	XRangeSelectionChangeListener.idl\

Modified: incubator/ooo/trunk/main/offapi/type_reference/types.rdb
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/offapi/type_reference/types.rdb?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/ooo/trunk/main/oox/inc/oox/xls/defnamesbuffer.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/inc/oox/xls/defnamesbuffer.hxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/inc/oox/xls/defnamesbuffer.hxx (original)
+++ incubator/ooo/trunk/main/oox/inc/oox/xls/defnamesbuffer.hxx Fri Sep  7 02:50:23 2012
@@ -155,7 +155,7 @@ private:
     typedef ::std::auto_ptr< StreamDataSequence >   StreamDataSeqPtr;
     typedef ::std::auto_ptr< BiffInputStreamPos >   BiffStreamPosPtr;
 
-    ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRange >
+    ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRange2 >
                         mxNamedRange;       /// XNamedRange interface of the defined name.
     sal_Int32           mnTokenIndex;       /// Name index used in API token array.
     sal_Int16           mnCalcSheet;        /// Calc sheet index for sheet-local names.

Modified: incubator/ooo/trunk/main/oox/inc/oox/xls/workbookhelper.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/inc/oox/xls/workbookhelper.hxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/inc/oox/xls/workbookhelper.hxx (original)
+++ incubator/ooo/trunk/main/oox/inc/oox/xls/workbookhelper.hxx Fri Sep  7 02:50:23 2012
@@ -34,7 +34,7 @@ namespace com { namespace sun { namespac
     namespace container { class XNameContainer; }
     namespace lang { class XMultiServiceFactory; }
     namespace sheet { class XDatabaseRange; }
-    namespace sheet { class XNamedRange; }
+    namespace sheet { class XNamedRange2; }
     namespace sheet { class XSpreadsheet; }
     namespace sheet { class XSpreadsheetDocument; }
     namespace style { class XStyle; }
@@ -182,7 +182,7 @@ 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 >
+    ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRange2 >
                         createNamedRangeObject(
                             ::rtl::OUString& orName,
 							sal_Int32 nSheetId = -1, //Add scope for name range

Modified: incubator/ooo/trunk/main/oox/source/token/properties.txt
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/source/token/properties.txt?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/source/token/properties.txt (original)
+++ incubator/ooo/trunk/main/oox/source/token/properties.txt Fri Sep  7 02:50:23 2012
@@ -284,6 +284,7 @@ MultiPageValue
 MultiSelection
 Name
 NamedRanges
+NamedRanges2
 NegativeError
 NullDate
 NumberFormat

Modified: incubator/ooo/trunk/main/oox/source/xls/sheetdatabuffer.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/source/xls/sheetdatabuffer.cxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/source/xls/sheetdatabuffer.cxx (original)
+++ incubator/ooo/trunk/main/oox/source/xls/sheetdatabuffer.cxx Fri Sep  7 02:50:23 2012
@@ -28,6 +28,7 @@
 #include <com/sun/star/sheet/XCellRangeData.hpp>
 #include <com/sun/star/sheet/XFormulaTokens.hpp>
 #include <com/sun/star/sheet/XMultipleOperation.hpp>
+#include <com/sun/star/sheet/XNamedRange2.hpp>
 #include <com/sun/star/table/XCell.hpp>
 #include <com/sun/star/text/XText.hpp>
 #include <com/sun/star/util/DateTime.hpp>
@@ -671,7 +672,7 @@ void SheetDataBuffer::createSharedFormul
         append( static_cast< sal_Int32 >( getSheetIndex() + 1 ) ).
         append( sal_Unicode( '_' ) ).append( rMapKey.mnRow ).
         append( sal_Unicode( '_' ) ).append( rMapKey.mnCol ).makeStringAndClear();
-    Reference< XNamedRange > xNamedRange = createNamedRangeObject( aName );
+    Reference< XNamedRange2 > xNamedRange = createNamedRangeObject( aName );
     OSL_ENSURE( xNamedRange.is(), "SheetDataBuffer::createSharedFormula - cannot create shared formula" );
     PropertySet aNameProps( xNamedRange );
     aNameProps.setProperty( PROP_IsSharedFormula, true );

Modified: incubator/ooo/trunk/main/oox/source/xls/workbookhelper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/source/xls/workbookhelper.cxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/source/xls/workbookhelper.cxx (original)
+++ incubator/ooo/trunk/main/oox/source/xls/workbookhelper.cxx Fri Sep  7 02:50:23 2012
@@ -28,8 +28,8 @@
 #include <com/sun/star/document/XActionLockable.hpp>
 #include <com/sun/star/sheet/XDatabaseRange.hpp>
 #include <com/sun/star/sheet/XDatabaseRanges.hpp>
-#include <com/sun/star/sheet/XNamedRange.hpp>
-#include <com/sun/star/sheet/XNamedRanges.hpp>
+#include <com/sun/star/sheet/XNamedRange2.hpp>
+#include <com/sun/star/sheet/XNamedRanges2.hpp>
 #include <com/sun/star/sheet/XSpreadsheet.hpp>
 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 #include <com/sun/star/style/XStyle.hpp>
@@ -133,7 +133,7 @@ public:
     /** Returns the specified cell or page style from the Calc document. */
     Reference< XStyle > getStyleObject( const OUString& rStyleName, bool bPageStyle ) const;
     /** Creates and returns a defined name on-the-fly in the Calc document. */
-    Reference< XNamedRange > createNamedRangeObject( OUString& orScope, OUString& orName, sal_Int32 nNameFlags ) const;
+    Reference< XNamedRange2 > createNamedRangeObject( OUString& orScope, OUString& orName, sal_Int32 nNameFlags ) const;
     /** Creates and returns a database range on-the-fly in the Calc document. */
     Reference< XDatabaseRange > createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const;
     /** Creates and returns a com.sun.star.style.Style object for cells or pages. */
@@ -348,15 +348,15 @@ Reference< XStyle > WorkbookGlobals::get
     return xStyle;
 }
 
-Reference< XNamedRange > WorkbookGlobals::createNamedRangeObject( OUString& orScope, OUString& orName, sal_Int32 nNameFlags ) const
+Reference< XNamedRange2 > WorkbookGlobals::createNamedRangeObject( OUString& orScope, OUString& orName, sal_Int32 nNameFlags ) const
 {
     // create the name and insert it into the Calc document
-    Reference< XNamedRange > xNamedRange;
+    Reference< XNamedRange2 > xNamedRange;
     if( orName.getLength() > 0 ) try
     {
         // find an unused name
         PropertySet aDocProps( mxDoc );
-        Reference< XNamedRanges > xNamedRanges( aDocProps.getAnyProperty( PROP_NamedRanges ), UNO_QUERY_THROW );
+        Reference< XNamedRanges2 > xNamedRanges( aDocProps.getAnyProperty( PROP_NamedRanges2 ), UNO_QUERY_THROW );
         Reference< XNameAccess > xNameAccess( xNamedRanges, UNO_QUERY_THROW );
         orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
         // create the named range
@@ -738,7 +738,7 @@ Reference< XStyle > WorkbookHelper::getS
     return mrBookGlob.getStyleObject( rStyleName, bPageStyle );
 }
 
-Reference< XNamedRange > WorkbookHelper::createNamedRangeObject( OUString& orName, sal_Int32 nSheetId, sal_Int32 nNameFlags ) const
+Reference< XNamedRange2 > WorkbookHelper::createNamedRangeObject( OUString& orName, sal_Int32 nSheetId, sal_Int32 nNameFlags ) const
 {
 	OUString orScope = nSheetId >= 0? getWorksheets().getCalcSheetName(nSheetId) : OUString();
     return mrBookGlob.createNamedRangeObject( orScope, orName, nNameFlags );

Modified: incubator/ooo/trunk/main/sc/inc/nameuno.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/inc/nameuno.hxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/inc/nameuno.hxx (original)
+++ incubator/ooo/trunk/main/sc/inc/nameuno.hxx Fri Sep  7 02:50:23 2012
@@ -30,10 +30,11 @@
 #include <com/sun/star/sheet/XLabelRange.hpp>
 #include <com/sun/star/sheet/XLabelRanges.hpp>
 #include <com/sun/star/sheet/XCellRangeReferrer.hpp>
-#include <com/sun/star/sheet/XNamedRange.hpp>
+#include <com/sun/star/sheet/XNamedRange2.hpp>
 #include <com/sun/star/sheet/XFormulaTokens.hpp>
-#include <com/sun/star/sheet/XNamedRanges.hpp>
+#include <com/sun/star/sheet/XNamedRanges2.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/sheet/RangeScopeName.hpp>
 #include <com/sun/star/lang/XServiceName.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
@@ -52,7 +53,7 @@ class ScTokenArray;
 
 
 class ScNamedRangeObj : public ::cppu::WeakImplHelper6<
-							::com::sun::star::sheet::XNamedRange,
+							::com::sun::star::sheet::XNamedRange2,
                             ::com::sun::star::sheet::XFormulaTokens,
 							::com::sun::star::sheet::XCellRangeReferrer,
 							::com::sun::star::beans::XPropertySet,
@@ -174,7 +175,7 @@ public:
 
 
 class ScNamedRangesObj : public ::cppu::WeakImplHelper5<
-							::com::sun::star::sheet::XNamedRanges,
+							::com::sun::star::sheet::XNamedRanges2,
 							::com::sun::star::container::XEnumerationAccess,
 							::com::sun::star::container::XIndexAccess,
                             ::com::sun::star::document::XActionLockable,

Modified: incubator/ooo/trunk/main/sc/inc/unonames.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/inc/unonames.hxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/inc/unonames.hxx (original)
+++ incubator/ooo/trunk/main/sc/inc/unonames.hxx Fri Sep  7 02:50:23 2012
@@ -44,6 +44,7 @@
 #define SC_UNO_COLLABELRNG			"ColumnLabelRanges"
 #define SC_UNO_DATABASERNG			"DatabaseRanges"
 #define SC_UNO_NAMEDRANGES			"NamedRanges"
+#define SC_UNO_NAMEDRANGES2			"NamedRanges2"
 #define SC_UNO_ROWLABELRNG			"RowLabelRanges"
 #define SC_UNO_SHEETLINKS			"SheetLinks"
 #define SC_UNO_FORBIDDEN			"ForbiddenCharacters"

Modified: incubator/ooo/trunk/main/sc/source/filter/xml/xmlexprt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/xml/xmlexprt.cxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/xml/xmlexprt.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/xml/xmlexprt.cxx Fri Sep  7 02:50:23 2012
@@ -113,8 +113,8 @@
 #include <com/sun/star/text/XText.hpp>
 #include <com/sun/star/sheet/XLabelRanges.hpp>
 #include <com/sun/star/sheet/XLabelRange.hpp>
-#include <com/sun/star/sheet/XNamedRanges.hpp>
-#include <com/sun/star/sheet/XNamedRange.hpp>
+#include <com/sun/star/sheet/XNamedRanges2.hpp>
+#include <com/sun/star/sheet/XNamedRange2.hpp>
 #include <com/sun/star/sheet/XCellRangeReferrer.hpp>
 #include <com/sun/star/sheet/NamedRangeFlag.hpp>
 #include <com/sun/star/container/XNamed.hpp>
@@ -3894,7 +3894,7 @@ void ScXMLExport::WriteNamedExpressions(
 	uno::Reference <beans::XPropertySet> xPropertySet (xSpreadDoc, uno::UNO_QUERY);
 	if (xPropertySet.is())
 	{
-        uno::Reference <sheet::XNamedRanges> xNamedRanges(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_NAMEDRANGES))), uno::UNO_QUERY);
+        uno::Reference <sheet::XNamedRanges2> xNamedRanges(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_NAMEDRANGES))), uno::UNO_QUERY);
 		CheckAttrList();
 		if (xNamedRanges.is())
 		{
@@ -3922,7 +3922,7 @@ void ScXMLExport::WriteNamedExpressions(
 						}
 						else if( nWhichTable !=MAXTABCOUNT)
 							continue;
-                        uno::Reference <sheet::XNamedRange> xNamedRange(xNamedRanges->getByScopeName(sRangeScope,sNamedRange), uno::UNO_QUERY);
+                        uno::Reference <sheet::XNamedRange2> xNamedRange(xNamedRanges->getByScopeName(sRangeScope,sNamedRange), uno::UNO_QUERY);
 						//range scope name support 
 						if (xNamedRange.is())
 						{

Modified: incubator/ooo/trunk/main/sc/source/filter/xml/xmlimprt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/xml/xmlimprt.cxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/xml/xmlimprt.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/xml/xmlimprt.cxx Fri Sep  7 02:50:23 2012
@@ -84,9 +84,9 @@
 #include <com/sun/star/util/NumberFormat.hpp>
 #include <com/sun/star/util/XNumberFormatTypes.hpp>
 #include <tools/urlobj.hxx>
-#include <com/sun/star/sheet/XNamedRanges.hpp>
+#include <com/sun/star/sheet/XNamedRanges2.hpp>
 #include <com/sun/star/sheet/NamedRangeFlag.hpp>
-#include <com/sun/star/sheet/XNamedRange.hpp>
+#include <com/sun/star/sheet/XNamedRange2.hpp>
 #include <com/sun/star/sheet/XLabelRanges.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
 
@@ -2733,7 +2733,7 @@ void ScXMLImport::SetNamedRanges()
         uno::Reference <beans::XPropertySet> xPropertySet (GetModel(), uno::UNO_QUERY);
         if (xPropertySet.is())
         {
-            uno::Reference <sheet::XNamedRanges> xNamedRanges(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_NAMEDRANGES))), uno::UNO_QUERY);
+            uno::Reference <sheet::XNamedRanges2> xNamedRanges(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_NAMEDRANGES))), uno::UNO_QUERY);
             if (xNamedRanges.is())
             {
                 ScMyNamedExpressions::iterator aItr(pNamedExpressions->begin());
@@ -2795,7 +2795,7 @@ void ScXMLImport::SetNamedRanges()
 						rtl::OUString sRangeScope( sTableName);
                         //uno::Reference <sheet::XNamedRange> xNamedRange(xNamedRanges->getByName((*aItr)->sName), uno::UNO_QUERY);
 						//getByScopeName
-						uno::Reference <sheet::XNamedRange> xNamedRange(xNamedRanges->getByScopeName( sRangeScope,(*aItr)->sName), uno::UNO_QUERY);
+						uno::Reference <sheet::XNamedRange2> xNamedRange(xNamedRanges->getByScopeName( sRangeScope,(*aItr)->sName), uno::UNO_QUERY);
                         if (xNamedRange.is())
                         {
                             LockSolarMutex();

Modified: incubator/ooo/trunk/main/sc/source/ui/unoobj/docuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/unoobj/docuno.cxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/unoobj/docuno.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/unoobj/docuno.cxx Fri Sep  7 02:50:23 2012
@@ -50,6 +50,7 @@
 
 #include <com/sun/star/util/Date.hpp>
 #include <com/sun/star/sheet/XNamedRanges.hpp>
+#include <com/sun/star/sheet/XNamedRanges2.hpp>
 #include <com/sun/star/sheet/XLabelRanges.hpp>
 #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
 #include <com/sun/star/script/XLibraryContainer.hpp>
@@ -135,6 +136,7 @@ const SfxItemPropertyMapEntry* lcl_GetDo
         {MAP_CHAR_LEN(SC_UNO_LOOKUPLABELS),      PROP_UNO_LOOKUPLABELS, &getBooleanCppuType(),                                    0, 0},
         {MAP_CHAR_LEN(SC_UNO_MATCHWHOLE),        PROP_UNO_MATCHWHOLE, &getBooleanCppuType(),                                    0, 0},
         {MAP_CHAR_LEN(SC_UNO_NAMEDRANGES),       0, &getCppuType((uno::Reference<sheet::XNamedRanges>*)0),    0, 0},
+        {MAP_CHAR_LEN(SC_UNO_NAMEDRANGES2),       0, &getCppuType((uno::Reference<sheet::XNamedRanges2>*)0),    0, 0},
         {MAP_CHAR_LEN(SC_UNO_DATABASERNG),       0, &getCppuType((uno::Reference<sheet::XDatabaseRanges>*)0), 0, 0},
         {MAP_CHAR_LEN(SC_UNO_NULLDATE),          PROP_UNO_NULLDATE, &getCppuType((util::Date*)0),                             0, 0},
         {MAP_CHAR_LEN(SC_UNO_ROWLABELRNG),       0, &getCppuType((uno::Reference<sheet::XLabelRanges>*)0),    0, 0},
@@ -1846,6 +1848,10 @@ uno::Any SAL_CALL ScModelObj::getPropert
 			ScUnoConversion::FillLocale( aLocale, eCtl );
 			aRet <<= aLocale;
 		}
+		else if ( aString.EqualsAscii( SC_UNO_NAMEDRANGES2 ) )
+		{
+			aRet <<= uno::Reference<sheet::XNamedRanges2>(new ScNamedRangesObj( pDocShell ));
+		}
 		else if ( aString.EqualsAscii( SC_UNO_NAMEDRANGES ) )
 		{
 			aRet <<= uno::Reference<sheet::XNamedRanges>(new ScNamedRangesObj( pDocShell ));

Modified: incubator/ooo/trunk/main/sc/source/ui/unoobj/nameuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/unoobj/nameuno.cxx?rev=1381844&r1=1381843&r2=1381844&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/unoobj/nameuno.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/unoobj/nameuno.cxx Fri Sep  7 02:50:23 2012
@@ -763,7 +763,7 @@ uno::Any SAL_CALL ScNamedRangesObj::getB
 									lang::WrappedTargetException, uno::RuntimeException)
 {
 	ScUnoGuard aGuard;
-	uno::Reference< sheet::XNamedRange >  xRange(GetObjectByIndex_Impl((sal_uInt16)nIndex));
+	uno::Reference< sheet::XNamedRange2 >  xRange(GetObjectByIndex_Impl((sal_uInt16)nIndex));
 	if ( xRange.is() )
         return uno::makeAny(xRange);
 	else
@@ -774,7 +774,7 @@ uno::Any SAL_CALL ScNamedRangesObj::getB
 uno::Type SAL_CALL ScNamedRangesObj::getElementType() throw(uno::RuntimeException)
 {
 	ScUnoGuard aGuard;
-	return ::getCppuType((const uno::Reference< sheet::XNamedRange >*)0);	// muss zu getByIndex passen
+	return ::getCppuType((const uno::Reference< sheet::XNamedRange2 >*)0);	// muss zu getByIndex passen
 }
 
 sal_Bool SAL_CALL ScNamedRangesObj::hasElements() throw(uno::RuntimeException)
@@ -788,7 +788,7 @@ uno::Any SAL_CALL ScNamedRangesObj::getB
 					lang::WrappedTargetException, uno::RuntimeException)
 {
 	ScUnoGuard aGuard;
-	uno::Reference< sheet::XNamedRange >  xRange(GetObjectByName_Impl(aName));
+	uno::Reference< sheet::XNamedRange2 >  xRange(GetObjectByName_Impl(aName));
 	if ( xRange.is() )
         return uno::makeAny(xRange);
 	else
@@ -801,7 +801,7 @@ uno::Any SAL_CALL ScNamedRangesObj::getB
 					lang::WrappedTargetException, uno::RuntimeException)
 {
 	ScUnoGuard aGuard;
-	uno::Reference< sheet::XNamedRange >  xRange(GetObjectByScopeName_Impl(aScopeName, aRangeName));
+	uno::Reference< sheet::XNamedRange2 >  xRange(GetObjectByScopeName_Impl(aScopeName, aRangeName));
 	if ( xRange.is() )
         return uno::makeAny(xRange);
 	else