Author: af Date: Tue Apr 23 12:33:28 2013 New Revision: 1470918 URL: http://svn.apache.org/r1470918 Log: 122051: Sidebar handles more Writer variants.
Modified: openoffice/trunk/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs openoffice/trunk/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx openoffice/trunk/main/sfx2/source/sidebar/EnumContext.cxx openoffice/trunk/main/sfx2/source/sidebar/ResourceManager.cxx openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx Modified: openoffice/trunk/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu URL: http://svn.apache.org/viewvc/openoffice/trunk/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu?rev=1470918&r1=1470917&r2=1470918&view=diff ============================================================================== --- openoffice/trunk/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu (original) +++ openoffice/trunk/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu Tue Apr 23 12:33:28 2013 @@ -240,11 +240,11 @@ DrawImpress, OutlineText, visible ; DrawImpress, Table, visible ; DrawImpress, TextObject, visible ; - WriterAndWeb, Annotation, visible ; - WriterAndWeb, DrawText, visible ; - WriterAndWeb, Table, visible ; - WriterAndWeb, Text, visible ; - WriterAndWeb, default, visible ; + WriterVariants, Annotation, visible ; + WriterVariants, DrawText, visible ; + WriterVariants, Table, visible ; + WriterVariants, Text, visible ; + WriterVariants, default, visible ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> @@ -344,11 +344,11 @@ </prop> <prop oor:name="ContextList"> <value oor:separator=";"> - Calc, Draw, visible ; - DrawImpress, 3DObject, visible ; - DrawImpress, Draw, visible ; - DrawImpress, TextObject, hidden ; - WriterAndWeb, Draw, visible ; + Calc, Draw, visible ; + DrawImpress, 3DObject, visible ; + DrawImpress, Draw, visible ; + DrawImpress, TextObject, hidden ; + WriterVariants, Draw, visible ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> @@ -374,13 +374,13 @@ </prop> <prop oor:name="ContextList"> <value oor:separator=";"> - Calc, Draw, visible ; - Calc, Graphic, visible ; - DrawImpress, 3DObject, visible ; - DrawImpress, Draw, visible ; - DrawImpress, Graphic, visible ; - DrawImpress, TextObject, hidden ; - WriterAndWeb, Draw, visible ; + Calc, Draw, visible ; + Calc, Graphic, visible ; + DrawImpress, 3DObject, visible ; + DrawImpress, Draw, visible ; + DrawImpress, Graphic, visible ; + DrawImpress, TextObject, hidden ; + WriterVariants, Draw, visible ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> @@ -432,26 +432,26 @@ </prop> <prop oor:name="ContextList"> <value oor:separator=";"> - Calc, Chart, visible ; - Calc, Draw, hidden ; - Calc, Form, visible ; - Calc, Graphic, hidden ; - Calc, Media, visible ; - Calc, MultiObject, visible ; - Calc, OLE, visible ; - DrawImpress, 3DObject, visible ; - DrawImpress, Draw, hidden ; - DrawImpress, Form, visible ; - DrawImpress, Graphic, hidden ; - DrawImpress, Media, visible ; - DrawImpress, MultiObject, visible ; - DrawImpress, OLE, visible ; - DrawImpress, TextObject, hidden ; - WriterAndWeb, Draw, hidden ; - WriterAndWeb, Form, visible ; - WriterAndWeb, Graphic, visible, .uno:GraphicDialog ; - WriterAndWeb, Media, visible ; - WriterAndWeb, OLE, visible, .uno:FrameDialog ; + Calc, Chart, visible ; + Calc, Draw, hidden ; + Calc, Form, visible ; + Calc, Graphic, hidden ; + Calc, Media, visible ; + Calc, MultiObject, visible ; + Calc, OLE, visible ; + DrawImpress, 3DObject, visible ; + DrawImpress, Draw, hidden ; + DrawImpress, Form, visible ; + DrawImpress, Graphic, hidden ; + DrawImpress, Media, visible ; + DrawImpress, MultiObject, visible ; + DrawImpress, OLE, visible ; + DrawImpress, TextObject, hidden ; + WriterVariants, Draw, hidden ; + WriterVariants, Form, visible ; + WriterVariants, Graphic, visible, .uno:GraphicDialog ; + WriterVariants, Media, visible ; + WriterVariants, OLE, visible, .uno:FrameDialog ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> @@ -476,7 +476,7 @@ <value oor:separator=";"> Calc, Graphic, visible ; DrawImpress, Graphic, visible ; - WriterAndWeb, Graphic, visible ; + WriterVariants, Graphic, visible ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> @@ -802,18 +802,18 @@ </prop> <prop oor:name="ContextList"> <value oor:separator=";"> - Calc, DrawText, visible ; - DrawImpress, 3DObject, hidden ; - DrawImpress, Draw, hidden ; - DrawImpress, DrawText, visible ; - DrawImpress, Graphic, hidden ; - DrawImpress, Table, visible ; - DrawImpress, TextObject, visible ; - WriterAndWeb, Annotation, visible ; - WriterAndWeb, DrawText, visible ; - WriterAndWeb, Table, visible ; - WriterAndWeb, Text, visible ; - WriterAndWeb, default, visible ; + Calc, DrawText, visible ; + DrawImpress, 3DObject, hidden ; + DrawImpress, Draw, hidden ; + DrawImpress, DrawText, visible ; + DrawImpress, Graphic, hidden ; + DrawImpress, Table, visible ; + DrawImpress, TextObject, visible ; + WriterVariants, Annotation, visible ; + WriterVariants, DrawText, visible ; + WriterVariants, Table, visible ; + WriterVariants, Text, visible ; + WriterVariants, default, visible ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> @@ -867,7 +867,7 @@ </prop> <prop oor:name="ContextList"> <value oor:separator=";"> - WriterAndWeb, any, visible ; + WriterVariants, any, visible ; </value> </prop> <prop oor:name="ImplementationURL" oor:type="xs:string"> Modified: openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs URL: http://svn.apache.org/viewvc/openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs?rev=1470918&r1=1470917&r2=1470918&view=diff ============================================================================== --- openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs (original) +++ openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs Tue Apr 23 12:33:28 2013 @@ -70,6 +70,9 @@ separated values (note that values are case sensitive): 1 Application name. Valid values are com.sun.star.text.TextDocument + com.sun.star.text.GlobalDocument + com.sun.star.text.WebDocument + com.sun.star.xforms.XMLFormDocument com.sun.star.sheet.SpreadsheetDocument com.sun.star.presentation.PresentationDocument com.sun.star.drawing.DrawingDocument @@ -82,9 +85,10 @@ Shortcuts for multiple applications: DrawImpress - WriterAndWeb + WriterVariants These shortcuts exist for even more convenience and handle the frequent case of Draw - and Impress as well as Writer and WriterWeb having otherwise identical context descriptions. + and Impress as well as different variants of the Writer where they have otherwise + identical context descriptions. Special values: any Modified: openoffice/trunk/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx?rev=1470918&r1=1470917&r2=1470918&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx (original) +++ openoffice/trunk/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx Tue Apr 23 12:33:28 2013 @@ -37,7 +37,9 @@ public: enum Application { Application_Writer, + Application_WriterGlobal, Application_WriterWeb, + Application_WriterXML, Application_Calc, Application_Draw, Application_Impress, @@ -46,8 +48,8 @@ public: // case that Draw and Impress use identical context configurations. Application_DrawImpress, - // Also for your convenience for either Writer or WriterWeb. - Application_WriterAndWeb, + // Also for your convenience for the different variants of Writer documents. + Application_WriterVariants, // Used only by deck or panel descriptors. Matches any // application. Modified: openoffice/trunk/main/sfx2/source/sidebar/EnumContext.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/EnumContext.cxx?rev=1470918&r1=1470917&r2=1470918&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/EnumContext.cxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/EnumContext.cxx Tue Apr 23 12:33:28 2013 @@ -95,8 +95,10 @@ sal_Int32 EnumContext::GetCombinedContex return CombinedEnumContext(Application_DrawImpress, meContext); case Application_Writer: + case Application_WriterGlobal: case Application_WriterWeb: - return CombinedEnumContext(Application_WriterAndWeb, meContext); + case Application_WriterXML: + return CombinedEnumContext(Application_WriterVariants, meContext); default: return CombinedEnumContext(meApplication, meContext); @@ -158,7 +160,9 @@ void EnumContext::ProvideApplicationCont { maApplicationVector.resize(static_cast<size_t>(EnumContext::__LastApplicationEnum)+1); AddEntry(A2S("com.sun.star.text.TextDocument"), EnumContext::Application_Writer); + AddEntry(A2S("com.sun.star.text.GlobalDocument"), EnumContext::Application_WriterGlobal); AddEntry(A2S("com.sun.star.text.WebDocument"), EnumContext::Application_WriterWeb); + AddEntry(A2S("com.sun.star.xforms.XMLFormDocument"), EnumContext::Application_WriterXML); AddEntry(A2S("com.sun.star.sheet.SpreadsheetDocument"), EnumContext::Application_Calc); AddEntry(A2S("com.sun.star.drawing.DrawingDocument"), EnumContext::Application_Draw); AddEntry(A2S("com.sun.star.presentation.PresentationDocument"), EnumContext::Application_Impress); Modified: openoffice/trunk/main/sfx2/source/sidebar/ResourceManager.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/ResourceManager.cxx?rev=1470918&r1=1470917&r2=1470918&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/ResourceManager.cxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/ResourceManager.cxx Tue Apr 23 12:33:28 2013 @@ -412,35 +412,41 @@ void ResourceManager::ReadContextList ( : sMenuCommandOverride) : rsDefaultMenuCommand); + // Setup a list of application enums. Note that the + // application name may result in more than one value (eg + // DrawImpress will result in two enums, one for Draw and one + // for Impress). + ::std::vector<EnumContext::Application> aApplications; EnumContext::Application eApplication (EnumContext::GetApplicationEnum(sApplicationName)); - EnumContext::Application eApplication2 (EnumContext::Application_None); if (eApplication == EnumContext::Application_None && !sApplicationName.equals(EnumContext::GetApplicationName(EnumContext::Application_None))) { // Handle some special names: abbreviations that make // context descriptions more readable. if (sApplicationName.equalsAscii("Writer")) - eApplication = EnumContext::Application_Writer; + aApplications.push_back(EnumContext::Application_Writer); else if (sApplicationName.equalsAscii("Calc")) - eApplication = EnumContext::Application_Calc; + aApplications.push_back(EnumContext::Application_Calc); else if (sApplicationName.equalsAscii("Draw")) - eApplication = EnumContext::Application_Draw; + aApplications.push_back(EnumContext::Application_Draw); else if (sApplicationName.equalsAscii("Impress")) - eApplication = EnumContext::Application_Impress; + aApplications.push_back(EnumContext::Application_Impress); else if (sApplicationName.equalsAscii("DrawImpress")) { // A special case among the special names: it is // common to use the same context descriptions for // both Draw and Impress. This special case helps to // avoid duplication in the .xcu file. - eApplication = EnumContext::Application_Draw; - eApplication2 = EnumContext::Application_Impress; + aApplications.push_back(EnumContext::Application_Draw); + aApplications.push_back(EnumContext::Application_Impress); } - else if (sApplicationName.equalsAscii("WriterAndWeb")) + else if (sApplicationName.equalsAscii("WriterVariants")) { - // Another special case for Writer and WriterWeb. - eApplication = EnumContext::Application_Writer; - eApplication2 = EnumContext::Application_WriterWeb; + // Another special case for all Writer variants. + aApplications.push_back(EnumContext::Application_Writer); + aApplications.push_back(EnumContext::Application_WriterGlobal); + aApplications.push_back(EnumContext::Application_WriterWeb); + aApplications.push_back(EnumContext::Application_WriterXML); } else { @@ -448,7 +454,13 @@ void ResourceManager::ReadContextList ( continue; } } - + else + { + // No conversion of the application name necessary. + aApplications.push_back(eApplication); + } + + // Setup the actual context enum. const EnumContext::Context eContext (EnumContext::GetContextEnum(sContextName)); if (eContext == EnumContext::Context_Unknown) { @@ -456,6 +468,8 @@ void ResourceManager::ReadContextList ( continue; } + // Setup the flag that controls whether a deck/pane is + // initially visible/expanded. bool bIsInitiallyVisible; if (sInitialState.equalsAscii("visible")) bIsInitiallyVisible = true; @@ -467,20 +481,21 @@ void ResourceManager::ReadContextList ( continue; } - if (eApplication != EnumContext::Application_None) - rContextList.AddContextDescription( - Context( - EnumContext::GetApplicationName(eApplication), - EnumContext::GetContextName(eContext)), - bIsInitiallyVisible, - sMenuCommand); - if (eApplication2 != EnumContext::Application_None) - rContextList.AddContextDescription( - Context( - EnumContext::GetApplicationName(eApplication2), - EnumContext::GetContextName(eContext)), - bIsInitiallyVisible, - sMenuCommand); + // Add context descriptors. + for (::std::vector<EnumContext::Application>::const_iterator + iApplication(aApplications.begin()), + iEnd(aApplications.end()); + iApplication!=iEnd; + ++iApplication) + { + if (*iApplication != EnumContext::Application_None) + rContextList.AddContextDescription( + Context( + EnumContext::GetApplicationName(*iApplication), + EnumContext::GetContextName(eContext)), + bIsInitiallyVisible, + sMenuCommand); + } } } Modified: openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx?rev=1470918&r1=1470917&r2=1470918&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx (original) +++ openoffice/trunk/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx Tue Apr 23 12:33:28 2013 @@ -205,8 +205,8 @@ void ParaPropertyPanel::HandleContextCha maTbxProDemoteBackground->Show(); break; - case CombinedEnumContext(Application_WriterAndWeb, Context_Default): - case CombinedEnumContext(Application_WriterAndWeb, Context_Text): + case CombinedEnumContext(Application_WriterVariants, Context_Default): + case CombinedEnumContext(Application_WriterVariants, Context_Text): maTBxVertAlign->Hide(); maTBxVertAlignBackground->Hide(); maTBxBackColor->Show(); @@ -221,7 +221,7 @@ void ParaPropertyPanel::HandleContextCha maTbxProDemoteBackground->Hide(); break; - case CombinedEnumContext(Application_WriterAndWeb, Context_Table): + case CombinedEnumContext(Application_WriterVariants, Context_Table): maTBxVertAlign->Show(); maTBxVertAlignBackground->Show(); maTBxBackColor->Show(); @@ -235,7 +235,7 @@ void ParaPropertyPanel::HandleContextCha maTbxProDemoteBackground->Hide(); break; - case CombinedEnumContext(Application_WriterAndWeb, Context_DrawText): + case CombinedEnumContext(Application_WriterVariants, Context_DrawText): maTBxVertAlign->Show(); maTBxVertAlignBackground->Show(); maTBxBackColor->Hide(); @@ -249,7 +249,7 @@ void ParaPropertyPanel::HandleContextCha maTbxProDemoteBackground->Hide(); break; - case CombinedEnumContext(Application_WriterAndWeb, Context_Annotation): + case CombinedEnumContext(Application_WriterVariants, Context_Annotation): maTBxVertAlign->Hide(); maTBxVertAlignBackground->Hide(); maTBxBackColor->Hide(); Modified: openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx?rev=1470918&r1=1470917&r2=1470918&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx (original) +++ openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx Tue Apr 23 12:33:28 2013 @@ -305,15 +305,15 @@ void PosSizePropertyPanel::HandleContext sal_Int32 nLayoutMode (0); switch (maContext.GetCombinedContext_DI()) { - case CombinedEnumContext(Application_WriterAndWeb, Context_Draw): + case CombinedEnumContext(Application_WriterVariants, Context_Draw): nLayoutMode = 0; break; - case CombinedEnumContext(Application_WriterAndWeb, Context_Graphic): - case CombinedEnumContext(Application_WriterAndWeb, Context_Media): - case CombinedEnumContext(Application_WriterAndWeb, Context_Frame): - case CombinedEnumContext(Application_WriterAndWeb, Context_OLE): - case CombinedEnumContext(Application_WriterAndWeb, Context_Form): + case CombinedEnumContext(Application_WriterVariants, Context_Graphic): + case CombinedEnumContext(Application_WriterVariants, Context_Media): + case CombinedEnumContext(Application_WriterVariants, Context_Frame): + case CombinedEnumContext(Application_WriterVariants, Context_OLE): + case CombinedEnumContext(Application_WriterVariants, Context_Form): nLayoutMode = 1; break; Modified: openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx?rev=1470918&r1=1470917&r2=1470918&view=diff ============================================================================== --- openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx (original) +++ openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx Tue Apr 23 12:33:28 2013 @@ -286,7 +286,7 @@ void TextPropertyPanel::HandleContextCha } maContext = aContext; - switch (maContext.GetCombinedContext_DI()) + switch (maContext.GetCombinedContext_DI()) // { case CombinedEnumContext(Application_Calc, Context_Cell): case CombinedEnumContext(Application_Calc, Context_Pivot): @@ -305,8 +305,8 @@ void TextPropertyPanel::HandleContextCha break; } - case CombinedEnumContext(Application_WriterAndWeb, Context_Text): - case CombinedEnumContext(Application_WriterAndWeb, Context_Table): + case CombinedEnumContext(Application_WriterVariants, Context_Text): + case CombinedEnumContext(Application_WriterVariants, Context_Table): { mpToolBoxScriptSw->Show(); mpToolBoxScript->Hide(); @@ -322,8 +322,8 @@ void TextPropertyPanel::HandleContextCha break; } - case CombinedEnumContext(Application_Writer, Context_DrawText): - case CombinedEnumContext(Application_Writer, Context_Annotation): + case CombinedEnumContext(Application_WriterVariants, Context_DrawText): + case CombinedEnumContext(Application_WriterVariants, Context_Annotation): { mpToolBoxScriptSw->Show(); mpToolBoxScript->Hide();