diff options
author | Andre Fischer <af@apache.org> | 2013-05-13 15:25:51 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-05-20 11:33:33 +0100 |
commit | cb7bbfe182ebbba3dfd9e32bb4937430db4b2f62 (patch) | |
tree | 6369bb08e4392fe717f2a1e7c0d596beced381de /svx | |
parent | e5818a4f5bd0f0c347e533c841c6663c2e223245 (diff) |
Resolves: #i121981# Don't change sidebar context while in Impress table
(cherry picked from commit a97c4ca2c235a4654243cbbdf970800454b5aa56)
Change-Id: I66ece2edb436b6e9f6bff110149d6c0c2aa37c7d
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/sidebar/SelectionAnalyzer.hxx | 5 | ||||
-rw-r--r-- | svx/source/sidebar/SelectionAnalyzer.cxx | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/svx/inc/svx/sidebar/SelectionAnalyzer.hxx b/svx/inc/svx/sidebar/SelectionAnalyzer.hxx index 05f8c0b4ee9d..601a96e977f9 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 44fa4073af6c..384f5f6bf033 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 { |