diff options
author | Gulsah Kose <gulsah.1004@gmail.com> | 2016-04-20 18:29:07 +0300 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-05-20 10:20:34 +0000 |
commit | b12354a2de297f05dcdf4602290b56d64675006a (patch) | |
tree | 926969bea08f00ff7ffb06c7438973680ee2d88f /sd/source | |
parent | 824cf015683383b553c744a746ac8e8ea65495cf (diff) |
tdf#87668 Add control to show or hide "Original Size" option.
Change-Id: I022ff86af2e480b061023aac50ff9f79fc6dbf9e
Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/24263
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 11 | ||||
-rw-r--r-- | sd/source/ui/view/sdview.cxx | 14 |
2 files changed, 13 insertions, 12 deletions
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 85e7ddb78c23..cd3162ec40e2 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1328,6 +1328,17 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) { bSingleGraphicSelected = nMarkCount == 1; const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj); + + // Current size of the OBJ_GRAF + const Rectangle aRect = static_cast<SdrObject*>(pObj)->GetLogicRect(); + const Size aCurrentSizeofObj = aRect.GetSize(); + + // Original size of the OBJ_GRAF + const Size aOriginalSizeofObj = pSdrGrafObj->getOriginalSize(); + + if(aCurrentSizeofObj == aOriginalSizeofObj ) + rSet.DisableItem(SID_ORIGINAL_SIZE); + switch(pSdrGrafObj->GetGraphicType()) { case GRAPHIC_BITMAP : diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index c6e44d353d80..c7d803119a99 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -886,18 +886,8 @@ void View::SetMarkedOriginalSize() } else if( pObj->GetObjIdentifier() == OBJ_GRAF ) { - const MapMode aMap100( MAP_100TH_MM ); - Size aSize; - - if ( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL ) - aSize = Application::GetDefaultDevice()->PixelToLogic( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefSize(), aMap100 ); - else - { - aSize = OutputDevice::LogicToLogic( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefSize(), - static_cast< SdrGrafObj* >( pObj )->GetGrafPrefMapMode(), - aMap100 ); - } - + const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj); + const Size aSize = pSdrGrafObj->getOriginalSize( ); pUndoGroup->AddAction( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj ) ); Rectangle aRect( pObj->GetLogicRect() ); aRect.SetSize( aSize ); |