summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2007-07-25 07:09:44 +0000
committerRüdiger Timm <rt@openoffice.org>2007-07-25 07:09:44 +0000
commitd7e95ed224e066a33c38ce07099c92ab6f4f3f0b (patch)
treebb3dc60ff519c0788ffac6d5f00e2eff7b58198e /sc
parentec35b24f9f4c81eea3719df5c2b485557da64eac (diff)
INTEGRATION: CWS chart07 (1.7.24); FILE MERGED
2007/07/13 15:15:10 nn 1.7.24.2: #i79013# implement create...Possible methods 2007/06/26 16:16:12 bm 1.7.24.1: XDataProvider: offer an API for reliably returning if it is possible to create data with the given arguments, not yet implemented (only trivial)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx48
1 files changed, 46 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index abe1382be675..ce811e60b2ca 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: chart2uno.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: vg $ $Date: 2007-05-22 20:11:06 $
+ * last change: $Author: rt $ $Date: 2007-07-25 08:09:44 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -274,6 +274,33 @@ void lcl_SeperateOneRowRange(ScRange aR, const ScAddress& rPos, ScRangeListRef&
}
}
+::sal_Bool SAL_CALL ScChart2DataProvider::createDataSourcePossible( const uno::Sequence< beans::PropertyValue >& aArguments )
+ throw (uno::RuntimeException)
+{
+ ScUnoGuard aGuard;
+ if( ! m_pDocument )
+ return false;
+
+ rtl::OUString aRangeRepresentation;
+ for(sal_Int32 i = 0; i < aArguments.getLength(); ++i)
+ {
+ rtl::OUString sName(aArguments[i].Name);
+ if (aArguments[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("CellRangeRepresentation")))
+ {
+ aArguments[i].Value >>= aRangeRepresentation;
+ }
+ }
+
+ ScRangeList aRangeList;
+ USHORT nResult = aRangeList.Parse( aRangeRepresentation, m_pDocument );
+ //! if anything is missing, SCA_VALID shouldn't be set
+ const USHORT nNeeded = SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB |
+ SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2;
+ bool bValid = ( (nResult & nNeeded ) == nNeeded );
+
+ return bValid;
+}
+
uno::Reference< chart2::data::XDataSource> SAL_CALL
ScChart2DataProvider::createDataSource(
const uno::Sequence< beans::PropertyValue >& aArguments )
@@ -935,6 +962,23 @@ void ScChart2DataProvider::detectArguments(
}
}
+::sal_Bool SAL_CALL ScChart2DataProvider::createDataSequenceByRangeRepresentationPossible( const ::rtl::OUString& aRangeRepresentation )
+ throw (uno::RuntimeException)
+{
+ ScUnoGuard aGuard;
+ if( ! m_pDocument )
+ return false;
+
+ ScRangeList aRangeList;
+ USHORT nResult = aRangeList.Parse( aRangeRepresentation, m_pDocument );
+ //! if anything is missing, SCA_VALID shouldn't be set
+ const USHORT nNeeded = SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB |
+ SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2;
+ bool bValid = ( (nResult & nNeeded ) == nNeeded );
+
+ return bValid;
+}
+
uno::Reference< chart2::data::XDataSequence > SAL_CALL
ScChart2DataProvider::createDataSequenceByRangeRepresentation(
const ::rtl::OUString& aRangeRepresentation )