summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2013-05-13 15:25:51 +0000
committerAndre Fischer <af@apache.org>2013-05-13 15:25:51 +0000
commita97c4ca2c235a4654243cbbdf970800454b5aa56 (patch)
tree61fc503c8461d7e46894c03823bb5563c8890508
parent2f18055a153f4e66ec72b0c20673032d6edeebab (diff)
121981: Don't change sidebar context while in Impress table.
Notes
-rw-r--r--sd/source/ui/view/drviewsa.cxx8
-rw-r--r--svx/inc/svx/sidebar/SelectionAnalyzer.hxx5
-rw-r--r--svx/source/sidebar/SelectionAnalyzer.cxx12
3 files changed, 17 insertions, 8 deletions
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 211907c94b5d..141011633ed0 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -871,14 +871,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 3f4fa14af8ef..0702a0a10c83 100644
--- a/svx/inc/svx/sidebar/SelectionAnalyzer.hxx
+++ b/svx/inc/svx/sidebar/SelectionAnalyzer.hxx
@@ -31,6 +31,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 233ba3700f17..52e1b9fb55b4 100644
--- a/svx/source/sidebar/SelectionAnalyzer.cxx
+++ b/svx/source/sidebar/SelectionAnalyzer.cxx
@@ -122,9 +122,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
{