Kaydet (Commit) a97c4ca2 authored tarafından Andre Fischer's avatar Andre Fischer

121981: Don't change sidebar context while in Impress table.

üst 2f18055a
......@@ -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,
......
......@@ -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 :
......
......@@ -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
{
......
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