summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2015-11-12 15:04:55 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2015-11-12 15:06:31 +0100
commit11921d2269ec993167d81a5ed47ea6c14fc1a5f6 (patch)
treeb662afb31fd4ce4a3033c06a00847c0947785c0e /svx/source
parent3f12102dde34cf88275c7249df5b234f487c5026 (diff)
Sidebar: Make the flip buttons available for Images in Writer also
And reduce copypasta Change-Id: I140bb8ad68bc35ba41c272cc4eb89b4a2d209a45
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx130
1 files changed, 26 insertions, 104 deletions
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 7ce660157ce4..89effbb61dae 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -269,19 +269,19 @@ void PosSizePropertyPanel::HandleContextChange(
maContext = rContext;
- sal_Int32 nLayoutMode (0);
+ bool bShowPosition = false;
+ bool bShowAngle = false;
+ bool bShowFlip = false;
+
switch (maContext.GetCombinedContext_DI())
{
case CombinedEnumContext(Application_WriterVariants, Context_Draw):
- nLayoutMode = 0;
+ bShowAngle = true;
+ bShowFlip = true;
break;
case CombinedEnumContext(Application_WriterVariants, Context_Graphic):
- case CombinedEnumContext(Application_WriterVariants, Context_Media):
- case CombinedEnumContext(Application_WriterVariants, Context_Frame):
- case CombinedEnumContext(Application_WriterVariants, Context_OLE):
- case CombinedEnumContext(Application_WriterVariants, Context_Form):
- nLayoutMode = 1;
+ bShowFlip = true;
break;
case CombinedEnumContext(Application_Calc, Context_Draw):
@@ -289,7 +289,9 @@ void PosSizePropertyPanel::HandleContextChange(
case CombinedEnumContext(Application_DrawImpress, Context_Draw):
case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
- nLayoutMode = 2;
+ bShowPosition = true;
+ bShowAngle = true;
+ bShowFlip = true;
break;
case CombinedEnumContext(Application_Calc, Context_Chart):
@@ -302,108 +304,28 @@ void PosSizePropertyPanel::HandleContextChange(
case CombinedEnumContext(Application_DrawImpress, Context_OLE):
case CombinedEnumContext(Application_DrawImpress, Context_3DObject):
case CombinedEnumContext(Application_DrawImpress, Context_MultiObject):
- nLayoutMode = 3;
+ bShowPosition = true;
break;
}
- switch (nLayoutMode)
- {
- case 0:
- {
- mpMtrWidth->SetMin( 2 );
- mpMtrHeight->SetMin( 2 );
- mpFtPosX->Hide();
- mpMtrPosX->Hide();
- mpFtPosY->Hide();
- mpMtrPosY->Hide();
-
- //rotation
- mpFtAngle->Show();
- mpMtrAngle->Show();
- mpDial->Show();
-
- //flip
- mpFtFlip->Show();
- mpFlipTbx->Show();
- mbIsFlip = true;
-
- if (mxSidebar.is())
- mxSidebar->requestLayout();
- }
- break;
+ // Position
+ mpFtPosX->Show(bShowPosition);
+ mpMtrPosX->Show(bShowPosition);
+ mpFtPosY->Show(bShowPosition);
+ mpMtrPosY->Show(bShowPosition);
- case 1:
- {
- mpMtrWidth->SetMin( 2 );
- mpMtrHeight->SetMin( 2 );
- mpFtPosX->Hide();
- mpMtrPosX->Hide();
- mpFtPosY->Hide();
- mpMtrPosY->Hide();
-
- //rotation
- mpFtAngle->Hide();
- mpMtrAngle->Hide();
- mpDial->Hide();
-
- //flip
- mpFlipTbx->Hide();
- mpFtFlip->Hide();
- mbIsFlip = false;
-
- if (mxSidebar.is())
- mxSidebar->requestLayout();
- }
- break;
+ // Rotation
+ mpFtAngle->Show(bShowAngle);
+ mpMtrAngle->Show(bShowAngle);
+ mpDial->Show(bShowAngle);
- case 2:
- {
- mpMtrWidth->SetMin( 1 );
- mpMtrHeight->SetMin( 1 );
- mpFtPosX->Show();
- mpMtrPosX->Show();
- mpFtPosY->Show();
- mpMtrPosY->Show();
-
- //rotation
- mpFtAngle->Show();
- mpMtrAngle->Show();
- mpDial->Show();
-
- //flip
- mpFlipTbx->Show();
- mpFtFlip->Show();
- mbIsFlip = true;
-
- if (mxSidebar.is())
- mxSidebar->requestLayout();
- }
- break;
+ // Flip
+ mpFtFlip->Show(bShowFlip);
+ mpFlipTbx->Show(bShowFlip);
+ mbIsFlip = bShowFlip;
- case 3:
- {
- mpMtrWidth->SetMin( 1 );
- mpMtrHeight->SetMin( 1 );
- mpFtPosX->Show();
- mpMtrPosX->Show();
- mpFtPosY->Show();
- mpMtrPosY->Show();
-
- //rotation
- mpFtAngle->Hide();
- mpMtrAngle->Hide();
- mpDial->Hide();
-
- //flip
- mpFlipTbx->Hide();
- mpFtFlip->Hide();
- mbIsFlip = false;
-
- if (mxSidebar.is())
- mxSidebar->requestLayout();
- }
- break;
- }
+ if (mxSidebar.is())
+ mxSidebar->requestLayout();
}