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

(cherry picked from commit a97c4ca2c235a4654243cbbdf970800454b5aa56)

Change-Id: I66ece2edb436b6e9f6bff110149d6c0c2aa37c7d
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index a580d60..86c20dd 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -829,14 +829,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 05f8c0b..601a96e 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 44fa407..384f5f6 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
            {