summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-02-17 17:10:57 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-02-22 14:02:03 -0500
commitc52c26e0c93576ad64a70396dccfd61c871f1759 (patch)
tree43144acf228514571a1c0a9ba1dd7472299fe508 /sc
parent561dd143665caa8f21648b1822156e37d1e352bb (diff)
Return original dimension position via UNO in case it's a duplicate.
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/unonames.hxx1
-rw-r--r--sc/source/core/data/dpobject.cxx8
-rw-r--r--sc/source/core/data/dptabsrc.cxx6
3 files changed, 11 insertions, 4 deletions
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 0a91ece456cf..44f1aea6cbae 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -565,6 +565,7 @@
#define SC_UNO_DP_COLGRAND "ColumnGrand"
#define SC_UNO_DP_ROWGRAND "RowGrand"
#define SC_UNO_DP_ORIGINAL "Original"
+#define SC_UNO_DP_ORIGINAL_POS "OriginalPosition"
#define SC_UNO_DP_ISDATALAYOUT "IsDataLayoutDimension"
#define SC_UNO_DP_ORIENTATION "Orientation"
#define SC_UNO_DP_POSITION "Position"
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 7696226bc1a9..13d8b690b18f 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2007,10 +2007,10 @@ bool ScDPObject::FillLabelData(ScPivotParam& rParam)
{
aFieldName = xDimName->getName();
uno::Any aOrigAny = xDimProp->getPropertyValue(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_DP_ORIGINAL)) );
- uno::Reference<uno::XInterface> xIntOrig;
- if ( (aOrigAny >>= xIntOrig) && xIntOrig.is() )
- bDuplicated = true;
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_DP_ORIGINAL_POS)));
+ sal_Int32 nOrigPos = -1;
+ if (aOrigAny >>= nOrigPos)
+ bDuplicated = nOrigPos >= 0;
}
catch(uno::Exception&)
{
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 26069264999d..5ee5325ab306 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -1491,6 +1491,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPDimension::getPropertySetIn
{MAP_CHAR_LEN(SC_UNO_DP_NUMBERFO), 0, &getCppuType((sal_Int32*)0), beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNO_DP_ORIENTATION), 0, &getCppuType((sheet::DataPilotFieldOrientation*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNO_DP_ORIGINAL), 0, &getCppuType((uno::Reference<container::XNamed>*)0), beans::PropertyAttribute::READONLY, 0 },
+ {MAP_CHAR_LEN(SC_UNO_DP_ORIGINAL_POS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNO_DP_POSITION), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNO_DP_REFVALUE), 0, &getCppuType((sheet::DataPilotFieldReference*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNO_DP_USEDHIERARCHY), 0, &getCppuType((sal_Int32*)0), 0, 0 },
@@ -1641,6 +1642,11 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert
xOriginal = pSource->GetDimensionsObject()->getByIndex(nSourceDim);
aRet <<= xOriginal;
}
+ else if (aPropertyName.equalsAscii(SC_UNO_DP_ORIGINAL_POS))
+ {
+ sal_Int32 nPos = static_cast<sal_Int32>(nSourceDim);
+ aRet <<= nPos;
+ }
else if ( aPropertyName.equalsAscii( SC_UNO_DP_FILTER ) )
{
if ( bHasSelectedPage )