Author: af Date: Mon May 13 15:25:51 2013 New Revision: 1481916 URL: http://svn.apache.org/r1481916 Log: 121981: Don't change sidebar context while in Impress table.
Modified: openoffice/trunk/main/sd/source/ui/view/drviewsa.cxx openoffice/trunk/main/svx/inc/svx/sidebar/SelectionAnalyzer.hxx openoffice/trunk/main/svx/source/sidebar/SelectionAnalyzer.cxx Modified: openoffice/trunk/main/sd/source/ui/view/drviewsa.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sd/source/ui/view/drviewsa.cxx?rev=1481916&r1=1481915&r2=1481916&view=diff ============================================================================== --- openoffice/trunk/main/sd/source/ui/view/drviewsa.cxx (original) +++ openoffice/trunk/main/sd/source/ui/view/drviewsa.cxx Mon May 13 15:25:51 2013 @@ -871,14 +871,10 @@ void DrawViewShell::GetAnnotationState ( } + + 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, Modified: openoffice/trunk/main/svx/inc/svx/sidebar/SelectionAnalyzer.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/inc/svx/sidebar/SelectionAnalyzer.hxx?rev=1481916&r1=1481915&r2=1481916&view=diff ============================================================================== --- openoffice/trunk/main/svx/inc/svx/sidebar/SelectionAnalyzer.hxx (original) +++ openoffice/trunk/main/svx/inc/svx/sidebar/SelectionAnalyzer.hxx Mon May 13 15:25:51 2013 @@ -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 : Modified: openoffice/trunk/main/svx/source/sidebar/SelectionAnalyzer.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/SelectionAnalyzer.cxx?rev=1481916&r1=1481915&r2=1481916&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/SelectionAnalyzer.cxx (original) +++ openoffice/trunk/main/svx/source/sidebar/SelectionAnalyzer.cxx Mon May 13 15:25:51 2013 @@ -122,9 +122,17 @@ EnumContext::Context SelectionAnalyzer:: 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 {