[Libreoffice-commits] core.git: Branch 'feature/sidebar' - 2 commits - sd/source svx/inc svx/source
Oliver-Rainer Wittmann
orw at apache.org
Tue May 14 12:42:25 PDT 2013
sd/source/ui/view/drviewsa.cxx | 8 --
svx/inc/svx/sidebar/SelectionAnalyzer.hxx | 5 +
svx/source/sidebar/SelectionAnalyzer.cxx | 12 ++-
svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx | 61 +++-------------
svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx | 2
svx/source/sidebar/paragraph/ParaPropertyPanel.hrc | 1
6 files changed, 32 insertions(+), 57 deletions(-)
New commits:
commit 328d162119b0130df5d69c80a66d6e22b66203a3
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Tue May 14 12:10:04 2013 +0000
Resolves: #i122270# paragraph property panel, line spacing control
do not directly select item via cursor travelling; removing obsolete code
(cherry picked from commit 6ca31d904b343c76899dfa2bfef3e7d20db23364)
Conflicts:
svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
Change-Id: I8b8ff06008dc0fdfc617f83a4a9c0f9569a8bd36
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
index cbb9320..e2fc093 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
@@ -67,7 +67,6 @@ ParaLineSpacingControl::ParaLineSpacingControl(Window* pParent, svx::sidebar::Pa
, maSpacing115 (SVX_RES(IMG_SPACING115))
, maSpacing15 (SVX_RES(IMG_SPACING15))
, maSpacing2 (SVX_RES(IMG_SPACING2))
- , maLPCustom (SVX_RES(IMG_SPACINGLCUSTOM))
, maSelSpacing1 (SVX_RES(IMG_SEL_SPACING1))
, maSelSpacing115 (SVX_RES(IMG_SEL_SPACING115))
, maSelSpacing15 (SVX_RES(IMG_SEL_SPACING15))
@@ -100,26 +99,20 @@ ParaLineSpacingControl::~ParaLineSpacingControl()
void ParaLineSpacingControl::initial()
{
- //maLineSpacing.SetStyle( maLineSpacing.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
- //maLineSpacing.SetControlBackground(GetSettings().GetStyleSettings().GetMenuColor());
- //maLineSpacing.SetColor(GetSettings().GetStyleSettings().GetMenuColor());
- //maLineSpacing.SetMinFont();
-
- maLineSpacing.SetControlBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
- GetSettings().GetStyleSettings().GetMenuColor():
- sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- maLineSpacing.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
- GetSettings().GetStyleSettings().GetMenuColor():
- sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- maLineSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
- GetSettings().GetStyleSettings().GetMenuColor():
- sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- //maFTSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
- //GetSettings().GetStyleSettings().GetMenuColor():
- //sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- //maFTBy.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
- //GetSettings().GetStyleSettings().GetMenuColor():
- //sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+ maLineSpacing.SetStyle( maLineSpacing.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
+
+ maLineSpacing.SetControlBackground(
+ GetSettings().GetStyleSettings().GetHighContrastMode()
+ ? GetSettings().GetStyleSettings().GetMenuColor()
+ : sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+ maLineSpacing.SetColor(
+ GetSettings().GetStyleSettings().GetHighContrastMode()
+ ? GetSettings().GetStyleSettings().GetMenuColor()
+ : sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+ maLineSpacing.SetBackground(
+ GetSettings().GetStyleSettings().GetHighContrastMode()
+ ? GetSettings().GetStyleSettings().GetMenuColor()
+ : sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
mpImg = new Image[4];
mpImg[0] = maSpacing1;
@@ -162,13 +155,7 @@ void ParaLineSpacingControl::initial()
aLineDistAtPercentBox.SetModifyHdl( aLink );
aLineDistAtMetricBox.SetModifyHdl( aLink );
}
-void ParaLineSpacingControl::ToGetFocus(bool bType)
-{
- if(!bType)
- aLineDist.GrabFocus();
- else
- maLineSpacing.GrabFocus(); //wj
-}
+
void ParaLineSpacingControl::PopupModeEndCallback()
{
@@ -483,24 +470,6 @@ void ParaLineSpacingControl::Rearrange(SfxItemState currSPState,FieldUnit currMe
aLineDist.SaveValue();
- /*sal_uInt16 nID = pBox->GetCurItemId();
- pBox->SetItemDown(nID, sal_True);
-
- Size aFloatSz = GetOutputSizePixel();
-
- GetLineSPFloatWin()->SetSizePixel( aFloatSz );
-
- Point aPos=maLineSPTbx->GetPosPixel();
- aPos.setX(aPos.getX());
- aPos = OutputToScreenPixel( aPos );
- Size aSize = maLineSPTbx->GetSizePixel();
- Rectangle aRect( aPos, aSize );
-
- GetLineSPFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_NOFOCUSCLOSE);
- GetLineSPFloatWin()->SetPopupModeFlags(GetLineSPFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
-
- pLineSPPage->ToGetFocus(bValueSetFocus);
- */
sal_uInt16 uCount = aLineDist.GetEntryCount();
if( uCount == LLINESPACE_FIX + 1 )
{
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx
index ed3f643..fc540c0 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx
@@ -40,7 +40,6 @@ class ParaLineSpacingControl:public svx::sidebar::PopupControl
public:
ParaLineSpacingControl(Window* pParent, svx::sidebar::ParaPropertyPanel& rPanel);
~ParaLineSpacingControl();
- void ToGetFocus(bool bType);
void Rearrange(SfxItemState currSPState,FieldUnit currMetricUnit,SvxLineSpacingItem* currSPItem,const ::sfx2::sidebar::EnumContext currentContext);
//virtual void Paint(const Rectangle& rect);
@@ -81,7 +80,6 @@ private:
Image maSpacing115;
Image maSpacing15;
Image maSpacing2;
- Image maLPCustom;
Image maSelSpacing1;
Image maSelSpacing115;
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc b/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
index 030d452..6ffb875 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
@@ -113,7 +113,6 @@
#define IMG_SPACING115 19
#define IMG_SPACING15 20
#define IMG_SPACING2 21
-#define IMG_SPACINGLCUSTOM 22
#define IMG_SEL_SPACING1 23
#define IMG_SEL_SPACING115 24
#define IMG_SEL_SPACING15 25
commit 2117bfe77d3dfc5eb778e27105bf6c91cafb0ec7
Author: Andre Fischer <af at apache.org>
Date: Mon May 13 15:25:51 2013 +0000
Resolves: #i121981# Don't change sidebar context while in Impress table
(cherry picked from commit a97c4ca2c235a4654243cbbdf970800454b5aa56)
Change-Id: I66ece2edb436b6e9f6bff110149d6c0c2aa37c7d
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index a580d60..86c20dd 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -829,14 +829,10 @@ void DrawViewShell::GetAnnotationState (SfxItemSet& rItemSet )
}
+
+
EnumContext::Context DrawViewShell::GetContextForSelection (void) const
{
- if (mpDrawView->GetMarkedObjectList().GetMarkCount() == 1)
- if (mpDrawView->GetTextEditObject() != NULL)
- if (mpDrawView->GetTextEditOutlinerView() != NULL)
- return EnumContext::Context_DrawText;
-
- // All other cases are handled by the SelectionAnalyzer.
return ::svx::sidebar::SelectionAnalyzer::GetContextForSelection_SD(
mpDrawView->GetMarkedObjectList(),
meEditMode == EM_MASTERPAGE,
diff --git a/svx/inc/svx/sidebar/SelectionAnalyzer.hxx b/svx/inc/svx/sidebar/SelectionAnalyzer.hxx
index 05f8c0b..601a96e 100644
--- a/svx/inc/svx/sidebar/SelectionAnalyzer.hxx
+++ b/svx/inc/svx/sidebar/SelectionAnalyzer.hxx
@@ -27,6 +27,11 @@ class SdrObject;
namespace svx { namespace sidebar {
+/** Analyze the current selection of Calc or Draw/Impress documents
+ and return the associated sidebar context.
+
+ The decision is based on heuristics. Do not expect pretty code.
+*/
class SVX_DLLPUBLIC SelectionAnalyzer
{
public :
diff --git a/svx/source/sidebar/SelectionAnalyzer.cxx b/svx/source/sidebar/SelectionAnalyzer.cxx
index 44fa407..384f5f6 100644
--- a/svx/source/sidebar/SelectionAnalyzer.cxx
+++ b/svx/source/sidebar/SelectionAnalyzer.cxx
@@ -117,9 +117,17 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD (
case 1:
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if ( pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsInEditMode() )
+ if (pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsInEditMode())
{
- eContext = EnumContext::Context_DrawText;
+ if (pObj->GetObjIdentifier() == OBJ_TABLE)
+ {
+ // Let a table object take precedence over text
+ // edit mode. The panels for text editing are
+ // present for table context as well, anyway.
+ eContext = EnumContext::Context_Table;
+ }
+ else
+ eContext = EnumContext::Context_DrawText;
}
else
{
More information about the Libreoffice-commits
mailing list