summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/dpobject.cxx35
-rw-r--r--sc/source/core/data/dpsave.cxx5
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/dptabsrc.cxx6
-rw-r--r--sc/source/core/data/pivot2.cxx1
4 files changed, 46 insertions, 1 deletions
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index e994339f4a9a..29ba9f15dc92 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -65,6 +65,7 @@
#include <com/sun/star/sheet/DataPilotTableHeaderData.hpp>
#include <com/sun/star/sheet/DataPilotTablePositionData.hpp>
#include <com/sun/star/sheet/DataPilotTablePositionType.hpp>
+#include <com/sun/star/sheet/DimensionFlags.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
@@ -845,7 +846,7 @@ bool ScDPObject::IsDimNameInUse(const OUString& rName) const
return false;
}
-String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout )
+String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout, sal_Int32* pFlags )
{
rIsDataLayout = FALSE;
String aRet;
@@ -879,6 +880,10 @@ String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout )
rIsDataLayout = TRUE;
else
aRet = String( aName );
+
+ if (pFlags)
+ *pFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp,
+ rtl::OUString::createFromAscii(SC_UNO_FLAGS), 0 );
}
}
}
@@ -2003,6 +2008,8 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam)
GetHierarchies(nDim, pNewLabel->maHiers);
GetMembers(nDim, GetUsedHierarchy(nDim), pNewLabel->maMembers);
lcl_FillLabelData(*pNewLabel, xDimProp);
+ pNewLabel->mnFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp,
+ rtl::OUString::createFromAscii(SC_UNO_FLAGS), 0 );
rParam.maLabelArray.push_back(pNewLabel);
}
}
@@ -2231,6 +2238,32 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData,
}
}
+// static
+bool ScDPObject::IsOrientationAllowed( USHORT nOrient, sal_Int32 nDimFlags )
+{
+ bool bAllowed = true;
+ switch (nOrient)
+ {
+ case sheet::DataPilotFieldOrientation_PAGE:
+ bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_PAGE_ORIENTATION ) == 0;
+ break;
+ case sheet::DataPilotFieldOrientation_COLUMN:
+ bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_COLUMN_ORIENTATION ) == 0;
+ break;
+ case sheet::DataPilotFieldOrientation_ROW:
+ bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_ROW_ORIENTATION ) == 0;
+ break;
+ case sheet::DataPilotFieldOrientation_DATA:
+ bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_DATA_ORIENTATION ) == 0;
+ break;
+ default:
+ {
+ // allowed to remove from previous orientation
+ }
+ }
+ return bAllowed;
+}
+
// -----------------------------------------------------------------------
// static
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index dd493bb0df6c..bad05968bf72 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -410,6 +410,11 @@ void ScDPSaveDimension::SetSubTotals(long nCount, const USHORT* pFuncs)
bSubTotalDefault = FALSE;
}
+bool ScDPSaveDimension::HasShowEmpty() const
+{
+ return nShowEmptyMode != SC_DPSAVEMODE_DONTKNOW;
+}
+
void ScDPSaveDimension::SetShowEmpty(BOOL bSet)
{
nShowEmptyMode = bSet;
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index da40e6e230c4..b4ca5dbc7330 100755..100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -1576,6 +1576,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPDimension::getPropertySetIn
static SfxItemPropertyMapEntry aDPDimensionMap_Impl[] =
{
{MAP_CHAR_LEN(SC_UNO_FILTER), 0, &getCppuType((uno::Sequence<sheet::TableFilterField>*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNO_FLAGS), 0, &getCppuType((sal_Int32*)0), beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNO_FUNCTION), 0, &getCppuType((sheet::GeneralFunction*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNO_ISDATALA), 0, &getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNO_NUMBERFO), 0, &getCppuType((sal_Int32*)0), beans::PropertyAttribute::READONLY, 0 },
@@ -1753,6 +1754,11 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert
aRet <<= mpSubtotalName.get() ? *mpSubtotalName : OUString::createFromAscii("");
else if (aNameStr.EqualsAscii(SC_UNO_HAS_HIDDEN_MEMBER))
aRet <<= mbHasHiddenMember;
+ else if (aNameStr.EqualsAscii(SC_UNO_FLAGS))
+ {
+ sal_Int32 nFlags = 0; // tabular data: all orientations are possible
+ aRet <<= nFlags;
+ }
else
{
DBG_ERROR("unknown property");
diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx
index 5a6174bc0129..ddac72f0230b 100644
--- a/sc/source/core/data/pivot2.cxx
+++ b/sc/source/core/data/pivot2.cxx
@@ -82,6 +82,7 @@ ScDPLabelData::ScDPLabelData( const String& rName, short nCol, bool bIsValue ) :
mnCol( nCol ),
mnFuncMask( PIVOT_FUNC_NONE ),
mnUsedHier( 0 ),
+ mnFlags( 0 ),
mbShowAll( false ),
mbIsValue( bIsValue )
{