diff options
Diffstat (limited to 'sd/source/ui/unoidl')
-rw-r--r-- | sd/source/ui/unoidl/unolayer.cxx | 66 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unolayer.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unoobj.cxx | 31 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 8 |
5 files changed, 13 insertions, 103 deletions
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 2096f4be704e..0a42ecdad7b3 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -75,62 +75,6 @@ static const SvxItemPropertySet* ImplGetSdLayerPropertySet() return &aSDLayerPropertySet_Impl; } -OUString SdLayer::convertToInternalName( const OUString& rName ) -{ - if ( rName == sUNO_LayerName_background ) - { - return SdResId( STR_LAYER_BCKGRND ); - } - else if ( rName == sUNO_LayerName_background_objects ) - { - return SdResId( STR_LAYER_BCKGRNDOBJ ); - } - else if ( rName == sUNO_LayerName_layout ) - { - return SdResId( STR_LAYER_LAYOUT ); - } - else if ( rName == sUNO_LayerName_controls ) - { - return SdResId( STR_LAYER_CONTROLS ); - } - else if ( rName == sUNO_LayerName_measurelines ) - { - return SdResId( STR_LAYER_MEASURELINES ); - } - else - { - return rName; - } -} - -OUString SdLayer::convertToExternalName( const OUString& rName ) -{ - if( rName == SdResId( STR_LAYER_BCKGRND ) ) - { - return OUString( sUNO_LayerName_background ); - } - else if( rName == SdResId( STR_LAYER_BCKGRNDOBJ ) ) - { - return OUString( sUNO_LayerName_background_objects ); - } - else if( rName == SdResId( STR_LAYER_LAYOUT ) ) - { - return OUString( sUNO_LayerName_layout ); - } - else if( rName == SdResId( STR_LAYER_CONTROLS ) ) - { - return OUString( sUNO_LayerName_controls ); - } - else if( rName == SdResId( STR_LAYER_MEASURELINES ) ) - { - return OUString( sUNO_LayerName_measurelines ); - } - else - { - return rName; - } -} - SdLayer::SdLayer(SdLayerManager* pLayerManager_, SdrLayer* pSdrLayer_) : mxLayerManager(pLayerManager_) , pLayer(pSdrLayer_) @@ -208,7 +152,7 @@ void SAL_CALL SdLayer::setPropertyValue( const OUString& aPropertyName, const un if(!(aValue >>= aName)) throw lang::IllegalArgumentException(); - pLayer->SetName(SdLayer::convertToInternalName( aName ) ); + pLayer->SetName(aName); mxLayerManager->UpdateLayerView(); break; } @@ -265,7 +209,7 @@ uno::Any SAL_CALL SdLayer::getPropertyValue( const OUString& PropertyName ) break; case WID_LAYER_NAME: { - OUString aRet( SdLayer::convertToExternalName( pLayer->GetName() ) ); + OUString aRet(pLayer->GetName()); aValue <<= aRet; break; } @@ -614,7 +558,7 @@ uno::Any SAL_CALL SdLayerManager::getByName( const OUString& aName ) throw lang::DisposedException(); SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin(); - SdrLayer* pLayer = rLayerAdmin.GetLayer( SdLayer::convertToInternalName( aName ) ); + SdrLayer* pLayer = rLayerAdmin.GetLayer(aName); if( pLayer == nullptr ) throw container::NoSuchElementException(); @@ -639,7 +583,7 @@ uno::Sequence< OUString > SAL_CALL SdLayerManager::getElementNames() { SdrLayer* pLayer = rLayerAdmin.GetLayer( nLayer ); if( pLayer ) - *pStrings++ = SdLayer::convertToExternalName( pLayer->GetName() ); + *pStrings++ = pLayer->GetName(); } return aSeq; @@ -654,7 +598,7 @@ sal_Bool SAL_CALL SdLayerManager::hasByName( const OUString& aName ) SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin(); - return nullptr != rLayerAdmin.GetLayer( SdLayer::convertToInternalName( aName ) ); + return nullptr != rLayerAdmin.GetLayer(aName); } // XElementAccess diff --git a/sd/source/ui/unoidl/unolayer.hxx b/sd/source/ui/unoidl/unolayer.hxx index 4388105c6c4e..a8ea2448f519 100644 --- a/sd/source/ui/unoidl/unolayer.hxx +++ b/sd/source/ui/unoidl/unolayer.hxx @@ -55,9 +55,6 @@ public: // intern SdrLayer* GetSdrLayer() const throw() { return pLayer; } - static OUString convertToInternalName( const OUString& rName ); - static OUString convertToExternalName( const OUString& rName ); - // uno helper UNO3_GETIMPLEMENTATION_DECL( SdLayer ) diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 2ba00268001c..bc9553287cec 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -471,8 +471,8 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) { sal_uInt16 nPageCount = mpDoc->GetSdPageCount( PageKind::Standard ); SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin(); - SdrLayerID aBckgrnd = rLayerAdmin.GetLayerID(SdResId(STR_LAYER_BCKGRND)); - SdrLayerID aBckgrndObj = rLayerAdmin.GetLayerID(SdResId(STR_LAYER_BCKGRNDOBJ)); + SdrLayerID aBckgrnd = rLayerAdmin.GetLayerID(sUNO_LayerName_background); + SdrLayerID aBckgrndObj = rLayerAdmin.GetLayerID(sUNO_LayerName_background_objects); SdPage* pStandardPage = nullptr; @@ -531,8 +531,8 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) pStandardPage->SetAutoLayout(AUTOLAYOUT_NONE, true ); } - aBckgrnd = rLayerAdmin.GetLayerID(SdResId(STR_LAYER_BCKGRND)); - aBckgrndObj = rLayerAdmin.GetLayerID(SdResId(STR_LAYER_BCKGRNDOBJ)); + aBckgrnd = rLayerAdmin.GetLayerID(sUNO_LayerName_background); + aBckgrndObj = rLayerAdmin.GetLayerID(sUNO_LayerName_background_objects); aVisibleLayers.Set(aBckgrnd, bIsPageBack); aVisibleLayers.Set(aBckgrndObj, bIsPageObj); pStandardPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index b24a6e5fd4df..18439a352df0 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -387,16 +387,6 @@ uno::Any SAL_CALL SdXShape::getPropertyDefault( const OUString& aPropertyName ) else { uno::Any aRet( mpShape->_getPropertyDefault(aPropertyName) ); - - if ( aPropertyName == sUNO_shape_layername ) - { - OUString aName; - if( aRet >>= aName ) - { - aName = SdLayer::convertToExternalName( aName ); - aRet <<= aName; - } - } return aRet; } } @@ -660,17 +650,6 @@ void SAL_CALL SdXShape::setPropertyValue( const OUString& aPropertyName, const c else { uno::Any aAny( aValue ); - - if ( aPropertyName == sUNO_shape_layername ) - { - OUString aName; - if( aAny >>= aName ) - { - aName = SdLayer::convertToInternalName( aName ); - aAny <<= aName; - } - } - mpShape->_setPropertyValue(aPropertyName, aAny); } @@ -815,16 +794,6 @@ css::uno::Any SAL_CALL SdXShape::getPropertyValue( const OUString& PropertyName else { aRet = mpShape->_getPropertyValue(PropertyName); - - if ( PropertyName == sUNO_shape_layername ) - { - OUString aName; - if( aRet >>= aName ) - { - aName = SdLayer::convertToExternalName( aName ); - aRet <<= aName; - } - } } return aRet; diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 95aec6b9b17e..fd703a97b9ce 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -764,7 +764,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName { SdrLayerAdmin& rLayerAdmin = rDoc.GetLayerAdmin(); SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); - aVisibleLayers.Set(rLayerAdmin.GetLayerID(SdResId(STR_LAYER_BCKGRND)), bVisible); + aVisibleLayers.Set(rLayerAdmin.GetLayerID(sUNO_LayerName_background), bVisible); pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); } } @@ -784,7 +784,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName { SdrLayerAdmin& rLayerAdmin = rDoc.GetLayerAdmin(); SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); - aVisibleLayers.Set(rLayerAdmin.GetLayerID(SdResId(STR_LAYER_BCKGRNDOBJ)), bVisible); + aVisibleLayers.Set(rLayerAdmin.GetLayerID(sUNO_LayerName_background_objects), bVisible); pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); } } @@ -1183,7 +1183,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) { SdrLayerAdmin& rLayerAdmin = rDoc.GetLayerAdmin(); SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); - aAny <<= aVisibleLayers.IsSet(rLayerAdmin.GetLayerID(SdResId(STR_LAYER_BCKGRND))); + aAny <<= aVisibleLayers.IsSet(rLayerAdmin.GetLayerID(sUNO_LayerName_background)); } else { @@ -1202,7 +1202,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) { SdrLayerAdmin& rLayerAdmin = rDoc.GetLayerAdmin(); SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); - aAny <<= aVisibleLayers.IsSet(rLayerAdmin.GetLayerID(SdResId(STR_LAYER_BCKGRNDOBJ))); + aAny <<= aVisibleLayers.IsSet(rLayerAdmin.GetLayerID(sUNO_LayerName_background_objects)); } else { |