Kaydet (Commit) cb7bbfe1 authored tarafından Andre Fischer's avatar Andre Fischer Kaydeden (comit) Michael Meeks

Resolves: #i121981# Don't change sidebar context while in Impress table

(cherry picked from commit a97c4ca2)

Change-Id: I66ece2edb436b6e9f6bff110149d6c0c2aa37c7d
üst e5818a4f
...@@ -829,14 +829,10 @@ void DrawViewShell::GetAnnotationState (SfxItemSet& rItemSet ) ...@@ -829,14 +829,10 @@ void DrawViewShell::GetAnnotationState (SfxItemSet& rItemSet )
} }
EnumContext::Context DrawViewShell::GetContextForSelection (void) const 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( return ::svx::sidebar::SelectionAnalyzer::GetContextForSelection_SD(
mpDrawView->GetMarkedObjectList(), mpDrawView->GetMarkedObjectList(),
meEditMode == EM_MASTERPAGE, meEditMode == EM_MASTERPAGE,
......
...@@ -27,6 +27,11 @@ class SdrObject; ...@@ -27,6 +27,11 @@ class SdrObject;
namespace svx { namespace sidebar { 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 class SVX_DLLPUBLIC SelectionAnalyzer
{ {
public : public :
......
...@@ -117,9 +117,17 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD ( ...@@ -117,9 +117,17 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD (
case 1: case 1:
{ {
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); 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 else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment