Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


I split the work into three patches in case part of this needed to be
rejected. The first patch implements the actual functionality and the
second patch cleans up what is unnecessary after the changes. For the
third patch, I noticed that there was a strange timer that would delay
loading the option page by 300ms each time a user would select
something in the tree on the left. I dispensed with it and the options
should load instantly now.

August Sodora
augsod@gmail.com
(201) 280-8138



On Sun, Dec 18, 2011 at 2:09 PM, Stefan Knorr (Astron)
<heinzlesspam@googlemail.com> wrote:
Hi Cor, August,

so, that doesn't seem too controversial, then, I guess. Or is there
just no one else on UX-advise?

August, you said that this is still a bit of a WIP, should this then
be pushed or should we wait for a larger patch?

Astron.
From de2dc148f889f3177d06af766a0e0ddb295a49d5 Mon Sep 17 00:00:00 2001
From: August Sodora <augsod@gmail.com>
Date: Fri, 16 Dec 2011 00:14:03 -0500
Subject: [PATCH 1/3] Automatically select an option page if a user clicks on
 a category

---
 cui/source/options/treeopt.cxx |   56 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 66210b7..5fdb53a 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1028,6 +1028,62 @@ IMPL_LINK( OfaTreeOptionsDialog, SelectHdl_Impl, Timer*, EMPTYARG )
         return 0;
     //#111938# lock the SelectHdl_Impl to prevent multiple executes
     FlagSet_Impl aFlag(bInSelectHdl_Impl);
+
+    // If the user has selected a category, automatically switch to a suitable
+    // default sub-page instead.
+    if (!pParent)
+    {
+        OptionsGroupInfo* pGroupInfo = static_cast<OptionsGroupInfo*>(pEntry->GetUserData());
+
+        if(!pGroupInfo)
+            return 0;
+
+        switch(pGroupInfo->m_nDialogId)
+        {
+        case SID_GENERAL_OPTIONS:
+            ActivatePage(RID_SFXPAGE_GENERAL);
+            break;
+        case SID_LANGUAGE_OPTIONS:
+            ActivatePage(OFA_TP_LANGUAGES);
+            break;
+        case SID_INET_DLG:
+            ActivatePage(RID_SVXPAGE_INET_PROXY);
+            break;
+        case SID_SW_EDITOPTIONS:
+            ActivatePage(RID_SW_TP_OPTLOAD_PAGE);
+            break;
+        case SID_SW_ONLINEOPTIONS:
+            ActivatePage(RID_SW_TP_HTML_CONTENT_OPT);
+            break;
+        case SID_SC_EDITOPTIONS:
+            ActivatePage(SID_SC_TP_LAYOUT);
+            break;
+        case SID_SD_EDITOPTIONS:
+            ActivatePage(SID_SI_TP_MISC);
+            break;
+        case SID_SD_GRAPHIC_OPTIONS:
+            ActivatePage(SID_SD_TP_MISC);
+            break;
+        case SID_SM_EDITOPTIONS:
+            ActivatePage(SID_SM_TP_PRINTOPTIONS);
+            break;
+        case SID_SCH_EDITOPTIONS:
+            ActivatePage(RID_OPTPAGE_CHART_DEFCOLORS);
+            break;
+        case SID_SB_STARBASEOPTIONS:
+            ActivatePage(SID_SB_CONNECTIONPOOLING);
+            break;
+        case SID_FILTER_DLG:
+            ActivatePage(RID_SFXPAGE_SAVE);
+            break;
+        default:
+            SAL_WARN("cui", "Unrecognized options category " << pGroupInfo->m_nDialogId);
+            break;
+        }
+
+        return 0;
+    }
+
     TabPage* pOldPage = NULL;
     TabPage* pNewPage = NULL;
     OptionsPageInfo* pOptPageInfo = ( pCurrentPageEntry && aTreeLB.GetParent( pCurrentPageEntry ) )
-- 
1.7.5.4

From 108d9edd4f7f6bbf4e94cfde29fd09296051545f Mon Sep 17 00:00:00 2001
From: August Sodora <augsod@gmail.com>
Date: Fri, 16 Dec 2011 00:59:10 -0500
Subject: [PATCH 2/3] Simplify treeopt select handler

---
 cui/source/inc/treeopt.hxx     |   33 +---
 cui/source/options/treeopt.cxx |  411 +++++++++++++---------------------------
 cui/source/options/treeopt.hrc |   21 --
 cui/source/options/treeopt.src |   82 --------
 4 files changed, 130 insertions(+), 417 deletions(-)

diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index af461fa..c6ba402 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -43,27 +43,6 @@
 sal_Bool            EnableSSO();
 CreateTabPage   GetSSOCreator( void );
 
-// class OfaOptionsTreeListBox -------------------------------------------
-
-class SfxModule;
-class SfxShell;
-class SfxItemSet;
-class XColorList;
-class OfaOptionsTreeListBox : public SvTreeListBox
-{
-    using  SvListView::Collapse;
-
-private:
-    sal_Bool            bInCollapse;
-
-public:
-    OfaOptionsTreeListBox(Window* pParent, const ResId& rResId) :
-        SvTreeListBox( pParent, rResId ), bInCollapse(sal_False) {}
-
-    virtual sal_Bool    Collapse( SvLBoxEntry* pParent );
-    sal_Bool            IsInCollapse()const {return bInCollapse;}
-};
-
 // struct OrderedEntry ---------------------------------------------------
 
 struct OrderedEntry
@@ -184,16 +163,8 @@ private:
     PushButton      aBackPB;
 
     FixedBorder     aHiddenGB;
-    FixedText       aPageTitleFT;
-    FixedLine       aLine1FL;
-    FixedText       aHelpFT;
-    FixedImage      aHelpImg;
-
-    ImageList       aPageImages;
-
-    ResStringArray  aHelpTextsArr;
 
-    OfaOptionsTreeListBox   aTreeLB;
+    SvTreeListBox   aTreeLB;
 
     String          sTitle;
     String          sNotLoadedError;
@@ -206,7 +177,6 @@ private:
 
     sal_Bool        bForgetSelection;
     sal_Bool        bExternBrowserActive;
-    sal_Bool        bImageResized;
     bool            bInSelectHdl_Impl;
     bool            bIsFromExtensionManager;
 
@@ -250,7 +220,6 @@ protected:
     DECL_LINK( SelectHdl_Impl, Timer * );
 
     virtual long    Notify( NotifyEvent& rNEvt );
-    virtual void    DataChanged( const DataChangedEvent& rDCEvt );
     virtual short   Execute();
 
 public:
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 5fdb53a..c07cf50 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -519,14 +519,6 @@ struct OptionsGroupInfo
     ~OptionsGroupInfo() { delete m_pInItemSet; delete m_pOutItemSet; }
 };
 
-sal_Bool OfaOptionsTreeListBox::Collapse( SvLBoxEntry* pParent )
-{
-    bInCollapse = sal_True;
-    sal_Bool bRet = SvTreeListBox::Collapse(pParent);
-    bInCollapse = sal_False;
-    return bRet;
-}
-
 // -----------------------------------------------------------------------
 
 #define INI_LIST() \
@@ -535,11 +527,6 @@ sal_Bool OfaOptionsTreeListBox::Collapse( SvLBoxEntry* pParent )
     aHelpPB             ( this, CUI_RES( PB_HELP ) ),\
     aBackPB             ( this, CUI_RES( PB_BACK ) ),\
     aHiddenGB           ( this, CUI_RES( FB_BORDER ) ),\
-    aPageTitleFT        ( this, CUI_RES( FT_PAGE_TITLE ) ),\
-    aLine1FL            ( this, CUI_RES( FL_LINE_1 ) ),\
-    aHelpFT             ( this, CUI_RES( FT_HELPTEXT ) ),\
-    aHelpImg            ( this, CUI_RES( IMG_HELP ) ),\
-    aHelpTextsArr       (       CUI_RES( STR_HELPTEXTS ) ),\
     aTreeLB             ( this, CUI_RES( TLB_PAGES ) ),\
     sTitle              ( GetText() ),\
     sNotLoadedError     (       CUI_RES( ST_LOAD_ERROR ) ),\
@@ -547,7 +534,6 @@ sal_Bool OfaOptionsTreeListBox::Collapse( SvLBoxEntry* pParent )
     pColorPageItemSet   ( NULL ),\
     mpColorPage         ( NULL ),\
     bForgetSelection    ( sal_False ),\
-    bImageResized       ( sal_False ),\
     bInSelectHdl_Impl   ( false ),\
     bIsFromExtensionManager( false ), \
     bIsForSetDocumentLanguage( false )
@@ -580,7 +566,6 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog( Window* pParent, const rtl::OUString
 
     SfxModalDialog( pParent, CUI_RES( RID_OFADLG_OPTIONS_TREE ) ),
     INI_LIST()
-
 {
     FreeResource();
 
@@ -821,8 +806,6 @@ void OfaTreeOptionsDialog::ApplyItemSets()
 void OfaTreeOptionsDialog::InitTreeAndHandler()
 {
     aTreeLB.SetNodeDefaultImages();
-    aPageImages = ImageList( CUI_RES( RID_IMGLIST_TREEOPT ) );
-
 
     aTreeLB.SetHelpId( HID_OFADLG_TREELISTBOX );
     aTreeLB.SetStyle( aTreeLB.GetStyle()|WB_HASBUTTONS | WB_HASBUTTONSATROOT |
@@ -988,26 +971,6 @@ long    OfaTreeOptionsDialog::Notify( NotifyEvent& rNEvt )
 
 // --------------------------------------------------------------------
 
-void OfaTreeOptionsDialog::DataChanged( const DataChangedEvent& rDCEvt )
-{
-    SfxModalDialog::DataChanged( rDCEvt );
-
-    SvLBoxEntry* pEntry = aTreeLB.GetCurEntry();
-    if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) &&
-        !aTreeLB.GetParent(pEntry))
-    {
-        OptionsGroupInfo* pInfo = static_cast<OptionsGroupInfo*>(pEntry->GetUserData());
-        ImageList* pImgLst = &aPageImages;
-        for ( sal_uInt16 i = 0; i < aHelpTextsArr.Count(); ++i )
-        {
-            if ( aHelpTextsArr.GetValue(i) == pInfo->m_nDialogId )
-            {
-                aHelpImg.SetImage( pImgLst->GetImage( pInfo->m_nDialogId ) );
-                break;
-            }
-        }
-    }
-}
 class FlagSet_Impl
 {
     bool & rFlag;
@@ -1120,281 +1083,169 @@ IMPL_LINK( OfaTreeOptionsDialog, SelectHdl_Impl, Timer*, EMPTYARG )
             pGroupInfo->m_pExtPage->DeactivatePage();
         }
     }
-    if ( pParent )
+
+    OptionsPageInfo *pPageInfo = (OptionsPageInfo *)pEntry->GetUserData();
+    OptionsGroupInfo* pGroupInfo = (OptionsGroupInfo *)pParent->GetUserData();
+    if(!pPageInfo->m_pPage && pPageInfo->m_nPageId > 0)
     {
-        aPageTitleFT.Hide();
-        aLine1FL.Hide();
-        aHelpFT.Hide();
-        aHelpImg.Hide();
-        OptionsPageInfo *pPageInfo = (OptionsPageInfo *)pEntry->GetUserData();
-        OptionsGroupInfo* pGroupInfo = (OptionsGroupInfo *)pParent->GetUserData();
-        if(!pPageInfo->m_pPage && pPageInfo->m_nPageId > 0)
+        if(pGroupInfo->m_bLoadError)
+            return 0;
+        if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
         {
-            if(pGroupInfo->m_bLoadError)
-                return 0;
-            if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
+            if(!pColorPageItemSet)
             {
-                if(!pColorPageItemSet)
-                {
-                    // Move usage of a static XOutdevItemPool instance here
-                    if(!mpStaticXOutdevItemPool)
-                    {
-                        mpStaticXOutdevItemPool = new XOutdevItemPool();
-                    }
-                    pColorPageItemSet = new SfxItemSet( *mpStaticXOutdevItemPool, XATTR_FILLSTYLE, 
XATTR_FILLCOLOR);
-                    pColorPageItemSet->Put( XFillColorItem() );
-                }
+                // Move usage of a static XOutdevItemPool instance here
+                if(!mpStaticXOutdevItemPool)
+                    mpStaticXOutdevItemPool = new XOutdevItemPool();
+
+                pColorPageItemSet = new SfxItemSet( *mpStaticXOutdevItemPool, XATTR_FILLSTYLE, 
XATTR_FILLCOLOR);
+                pColorPageItemSet->Put( XFillColorItem() );
             }
-            else
+        }
+        else
+        {
+            if(pGroupInfo->m_pModule /*&& !pGroupInfo->pModule->IsLoaded()*/)
             {
-                if(pGroupInfo->m_pModule /*&& !pGroupInfo->pModule->IsLoaded()*/)
-                {
-                    SfxModule* pOldModule = pGroupInfo->m_pModule;
-                    sal_Bool bIdentical = pGroupInfo->m_pModule == pGroupInfo->m_pShell;
+                SfxModule* pOldModule = pGroupInfo->m_pModule;
+                sal_Bool bIdentical = pGroupInfo->m_pModule == pGroupInfo->m_pShell;
 
-                    WaitObject aWait(this);
-                    //pGroupInfo->pModule = pGroupInfo->pModule->Load();
-                    if(!pGroupInfo->m_pModule)
-                    {
-                        pGroupInfo->m_bLoadError = sal_True;
-                        InfoBox(pBox, sNotLoadedError).Execute();
-                        return 0;
-                    }
-                    if(bIdentical)
-                         pGroupInfo->m_pShell = pGroupInfo->m_pModule;
-                    //jetzt noch testen, ob es auch in anderen Gruppen das gleiche Module gab 
(z.B. Text+HTML)
-                    SvLBoxEntry* pTemp = aTreeLB.First();
-                    while(pTemp)
+                WaitObject aWait(this);
+                //pGroupInfo->pModule = pGroupInfo->pModule->Load();
+                if(!pGroupInfo->m_pModule)
+                {
+                    pGroupInfo->m_bLoadError = sal_True;
+                    InfoBox(pBox, sNotLoadedError).Execute();
+                    return 0;
+                }
+                if(bIdentical)
+                    pGroupInfo->m_pShell = pGroupInfo->m_pModule;
+                //jetzt noch testen, ob es auch in anderen Gruppen das gleiche Module gab (z.B. 
Text+HTML)
+                SvLBoxEntry* pTemp = aTreeLB.First();
+                while(pTemp)
+                {
+                    if(!aTreeLB.GetParent(pTemp) && pTemp != pEntry)
                     {
-                        if(!aTreeLB.GetParent(pTemp) && pTemp != pEntry)
+                        OptionsGroupInfo* pTGInfo = (OptionsGroupInfo *)pTemp->GetUserData();
+                        if(pTGInfo->m_pModule == pOldModule)
                         {
-                            OptionsGroupInfo* pTGInfo = (OptionsGroupInfo *)pTemp->GetUserData();
-                            if(pTGInfo->m_pModule == pOldModule)
-                            {
-                                pTGInfo->m_pModule = pGroupInfo->m_pModule;
-                                if(bIdentical)
-                                    pTGInfo->m_pShell = pGroupInfo->m_pModule;
-                            }
+                            pTGInfo->m_pModule = pGroupInfo->m_pModule;
+                            if(bIdentical)
+                                pTGInfo->m_pShell = pGroupInfo->m_pModule;
                         }
-                        pTemp = aTreeLB.Next(pTemp);
                     }
-                }
-
-//              if ( pPageInfo->nPageId != RID_OPTPAGE_CHART_DEFCOLORS )
-                {
-                    if(!pGroupInfo->m_pInItemSet)
-                        pGroupInfo->m_pInItemSet = pGroupInfo->m_pShell
-                            ? pGroupInfo->m_pShell->CreateItemSet( pGroupInfo->m_nDialogId )
-                            : CreateItemSet( pGroupInfo->m_nDialogId );
-                    if(!pGroupInfo->m_pOutItemSet)
-                        pGroupInfo->m_pOutItemSet = new SfxItemSet(
-                            *pGroupInfo->m_pInItemSet->GetPool(),
-                            pGroupInfo->m_pInItemSet->GetRanges());
+                    pTemp = aTreeLB.Next(pTemp);
                 }
             }
 
-            if(pGroupInfo->m_pModule)
-            {
-                pPageInfo->m_pPage = pGroupInfo->m_pModule->CreateTabPage(
-                    pPageInfo->m_nPageId, this, *pGroupInfo->m_pInItemSet );
-            }
-            else if(RID_SVXPAGE_COLOR != pPageInfo->m_nPageId)
-                pPageInfo->m_pPage = ::CreateGeneralTabPage( pPageInfo->m_nPageId, this, 
*pGroupInfo->m_pInItemSet );
-            else
-            {
-                pPageInfo->m_pPage = ::CreateGeneralTabPage(
-                    pPageInfo->m_nPageId, this, *pColorPageItemSet );
-                mpColorPage = (SvxColorTabPage*)pPageInfo->m_pPage;
-                mpColorPage->SetupForViewFrame( SfxViewFrame::Current() );
-            }
+            if(!pGroupInfo->m_pInItemSet)
+                pGroupInfo->m_pInItemSet = pGroupInfo->m_pShell
+                    ? pGroupInfo->m_pShell->CreateItemSet( pGroupInfo->m_nDialogId )
+                    : CreateItemSet( pGroupInfo->m_nDialogId );
+            if(!pGroupInfo->m_pOutItemSet)
+                pGroupInfo->m_pOutItemSet = new SfxItemSet(
+                    *pGroupInfo->m_pInItemSet->GetPool(),
+                    pGroupInfo->m_pInItemSet->GetRanges());
+        }
 
-            DBG_ASSERT( pPageInfo->m_pPage, "tabpage could not created");
-            if ( pPageInfo->m_pPage )
-            {
-                SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( 
pPageInfo->m_nPageId ) );
-                pPageInfo->m_pPage->SetUserData( GetViewOptUserItem( aTabPageOpt ) );
-
-                Point aTreePos(aTreeLB.GetPosPixel());
-                Size aTreeSize(aTreeLB.GetSizePixel());
-                Point aGBPos(aHiddenGB.GetPosPixel());
-                Size aPageSize(pPageInfo->m_pPage->GetSizePixel());
-                Size aGBSize(aHiddenGB.GetSizePixel());
-                Point aPagePos( aGBPos.X() + ( aGBSize.Width() - aPageSize.Width() ) / 2,
-                                aGBPos.Y() + ( aGBSize.Height() - aPageSize.Height() ) / 2 );
-                pPageInfo->m_pPage->SetPosPixel( aPagePos );
-                if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
-                {
-                    pPageInfo->m_pPage->Reset( *pColorPageItemSet );
-                    pPageInfo->m_pPage->ActivatePage( *pColorPageItemSet );
-                }
-                else
-                {
-                    pPageInfo->m_pPage->Reset( *pGroupInfo->m_pInItemSet );
-                }
-            }
+        if(pGroupInfo->m_pModule)
+        {
+            pPageInfo->m_pPage = pGroupInfo->m_pModule->CreateTabPage(
+                pPageInfo->m_nPageId, this, *pGroupInfo->m_pInItemSet );
         }
-        else if ( 0 == pPageInfo->m_nPageId && !pPageInfo->m_pExtPage )
+        else if(RID_SVXPAGE_COLOR != pPageInfo->m_nPageId)
+            pPageInfo->m_pPage = ::CreateGeneralTabPage( pPageInfo->m_nPageId, this, 
*pGroupInfo->m_pInItemSet );
+        else
         {
-            if ( !m_xContainerWinProvider.is() )
-            {
-                Reference < XMultiServiceFactory > xFactory( 
::comphelper::getProcessServiceFactory() );
-                m_xContainerWinProvider = Reference < awt::XContainerWindowProvider >(
-                    xFactory->createInstance(
-                        C2U("com.sun.star.awt.ContainerWindowProvider") ), UNO_QUERY );
-                DBG_ASSERT( m_xContainerWinProvider.is(), "service 
com.sun.star.awt.ContainerWindowProvider could not be loaded" );
-            }
-
-            pPageInfo->m_pExtPage = new ExtensionsTabPage(
-                this, 0, pPageInfo->m_sPageURL, pPageInfo->m_sEventHdl, m_xContainerWinProvider );
-            Size aSize = aHiddenGB.GetSizePixel();
-            aSize.Width() = aSize.Width() - 4;
-            aSize.Height() = aSize.Height() - 4;
-            Point aPos = aHiddenGB.GetPosPixel();
-            aPos.X() = aPos.X() + 2;
-            aPos.Y() = aPos.Y() + 2;
-            pPageInfo->m_pExtPage->SetPosSizePixel( aPos, aSize );
+            pPageInfo->m_pPage = ::CreateGeneralTabPage(
+                pPageInfo->m_nPageId, this, *pColorPageItemSet );
+            mpColorPage = (SvxColorTabPage*)pPageInfo->m_pPage;
+            mpColorPage->SetupForViewFrame( SfxViewFrame::Current() );
         }
 
+        DBG_ASSERT( pPageInfo->m_pPage, "tabpage could not created");
         if ( pPageInfo->m_pPage )
         {
-            if ( RID_SVXPAGE_COLOR != pPageInfo->m_nPageId &&
-                 pPageInfo->m_pPage->HasExchangeSupport())
+            SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pPageInfo->m_nPageId ) 
);
+            pPageInfo->m_pPage->SetUserData( GetViewOptUserItem( aTabPageOpt ) );
+
+            Point aTreePos(aTreeLB.GetPosPixel());
+            Size aTreeSize(aTreeLB.GetSizePixel());
+            Point aGBPos(aHiddenGB.GetPosPixel());
+            Size aPageSize(pPageInfo->m_pPage->GetSizePixel());
+            Size aGBSize(aHiddenGB.GetSizePixel());
+            Point aPagePos( aGBPos.X() + ( aGBSize.Width() - aPageSize.Width() ) / 2,
+                            aGBPos.Y() + ( aGBSize.Height() - aPageSize.Height() ) / 2 );
+            pPageInfo->m_pPage->SetPosPixel( aPagePos );
+            if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
             {
-                pPageInfo->m_pPage->ActivatePage(*pGroupInfo->m_pOutItemSet);
+                pPageInfo->m_pPage->Reset( *pColorPageItemSet );
+                pPageInfo->m_pPage->ActivatePage( *pColorPageItemSet );
             }
-            pPageInfo->m_pPage->Show();
-        }
-        else if ( pPageInfo->m_pExtPage )
-        {
-            pPageInfo->m_pExtPage->Show();
-            pPageInfo->m_pExtPage->ActivatePage();
-        }
-
-        String sTmpTitle = sTitle;
-        sTmpTitle += String::CreateFromAscii(" - ");
-        sTmpTitle += aTreeLB.GetEntryText(pParent);
-        sTmpTitle += String::CreateFromAscii(" - ");
-        sTmpTitle += aTreeLB.GetEntryText(pEntry);
-        SetText(sTmpTitle);
-        pCurrentPageEntry = pEntry;
-        if ( !bForgetSelection )
-        {
-            if ( !pLastPageSaver )
-                pLastPageSaver = new LastPageSaver;
-            if ( !bIsFromExtensionManager )
-                pLastPageSaver->m_nLastPageId = pPageInfo->m_nPageId;
-            if ( pPageInfo->m_pExtPage )
+            else
             {
-                if ( bIsFromExtensionManager )
-                    pLastPageSaver->m_sLastPageURL_ExtMgr = pPageInfo->m_sPageURL;
-                else
-                    pLastPageSaver->m_sLastPageURL_Tools = pPageInfo->m_sPageURL;
+                pPageInfo->m_pPage->Reset( *pGroupInfo->m_pInItemSet );
             }
         }
-        pNewPage = pPageInfo->m_pPage;
     }
-    else
+    else if ( 0 == pPageInfo->m_nPageId && !pPageInfo->m_pExtPage )
     {
-        OptionsGroupInfo* pTGInfo = (OptionsGroupInfo *)pEntry->GetUserData();
-        if ( pTGInfo->m_sPageURL.getLength() == 0 )
+        if ( !m_xContainerWinProvider.is() )
         {
-            ImageList* pImgLst = &aPageImages;
-            //hier den Hilfetext anzeigen
-            for ( sal_uInt16 i = 0; i < aHelpTextsArr.Count(); ++i )
-            {
-                if ( aHelpTextsArr.GetValue(i) == pTGInfo->m_nDialogId )
-                {
-                    aHelpFT.SetText(aHelpTextsArr.GetString(i));
-                    aHelpImg.SetImage(pImgLst->GetImage(pTGInfo->m_nDialogId));
-                    break;
-                }
-            }
-
-            aPageTitleFT.Show();
-            aLine1FL.Show();
-            aHelpFT.Show();
-            aHelpImg.Show();
-
-            //auf die Groesse der Bitmap anpassen
-            if(!bImageResized)
-            {
-                const long nCtrlDist = 2;
-                bImageResized = sal_True;
-                Point aImgPos(aHelpImg.GetPosPixel());
-                Size aImgSize(aHelpImg.GetSizePixel());
-                Point aTitlePos(aPageTitleFT.GetPosPixel());
-                Point aLinePos(aLine1FL.GetPosPixel());
-                Point aHelpPos(aHelpFT.GetPosPixel());
-                Size aHelpSize(aHelpFT.GetSizePixel());
-                long nXDiff = 0;
-                long nYDiff = 0;
-                if(aTitlePos.X() <= (aImgPos.X() + aImgSize.Width() + nCtrlDist))
-                {
-                    nXDiff = aImgPos.X() + aImgSize.Width() + nCtrlDist - aTitlePos.X();
-                }
-                if(aLinePos.Y() <= (aImgPos.Y() + aImgSize.Height() + nCtrlDist))
-                {
-                    nYDiff = aImgPos.Y() + aImgSize.Height() + nCtrlDist - aLinePos.Y();
-                }
-                aLinePos.Y() += nYDiff;
-                aLine1FL.SetPosPixel(aLinePos);
-
-                aTitlePos.X() += nXDiff;
-                aPageTitleFT.SetPosPixel(aTitlePos);
-
-                aHelpPos.X() += nXDiff;
-                aHelpPos.Y() += nYDiff;
-                aHelpSize.Width() -= nXDiff;
-                aHelpSize.Height() -= nYDiff;
-                aHelpFT.SetPosSizePixel(aHelpPos, aHelpSize);
-
-                Font aFont = aHelpFT.GetFont();
-                Size aSz = aFont.GetSize();
-                aSz.Height() = (aSz.Height() * 14 ) / 10;
-                aFont.SetSize(aSz);
-                aPageTitleFT.SetFont(aFont);
-            }
-
-            String sTmpTitle = sTitle;
-            sTmpTitle += String::CreateFromAscii(" - ");
-            aPageTitleFT.SetText(aTreeLB.GetEntryText(pEntry));
-            sTmpTitle += aPageTitleFT.GetText();
-            SetText(sTmpTitle);
-            pCurrentPageEntry = NULL;
+            Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() 
);
+            m_xContainerWinProvider = Reference < awt::XContainerWindowProvider >(
+                xFactory->createInstance(
+                C2U("com.sun.star.awt.ContainerWindowProvider") ), UNO_QUERY );
+            DBG_ASSERT( m_xContainerWinProvider.is(), "service 
com.sun.star.awt.ContainerWindowProvider could not be loaded" );
         }
-        else
-        {
-            if ( !pTGInfo->m_pExtPage )
-            {
-                if ( !m_xContainerWinProvider.is() )
-                {
-                    Reference < XMultiServiceFactory > xFactory( 
::comphelper::getProcessServiceFactory() );
-                    m_xContainerWinProvider = Reference < awt::XContainerWindowProvider >(
-                        xFactory->createInstance(
-                            C2U("com.sun.star.awt.ContainerWindowProvider") ), UNO_QUERY );
-                    DBG_ASSERT( m_xContainerWinProvider.is(), "service 
com.sun.star.awt.ContainerWindowProvider could not be loaded" );
-                }
 
-                pTGInfo->m_pExtPage =
-                    new ExtensionsTabPage( this, 0, pTGInfo->m_sPageURL, rtl::OUString(), 
m_xContainerWinProvider );
-                Size aSize = aHiddenGB.GetSizePixel();
-                aSize.Width() = aSize.Width() - 4;
-                aSize.Height() = aSize.Height() - 4;
-                Point aPos = aHiddenGB.GetPosPixel();
-                aPos.X() = aPos.X() + 2;
-                aPos.Y() = aPos.Y() + 2;
-                pTGInfo->m_pExtPage->SetPosSizePixel( aPos, aSize );
-            }
+        pPageInfo->m_pExtPage = new ExtensionsTabPage(
+            this, 0, pPageInfo->m_sPageURL, pPageInfo->m_sEventHdl, m_xContainerWinProvider );
+        Size aSize = aHiddenGB.GetSizePixel();
+        aSize.Width() = aSize.Width() - 4;
+        aSize.Height() = aSize.Height() - 4;
+        Point aPos = aHiddenGB.GetPosPixel();
+        aPos.X() = aPos.X() + 2;
+        aPos.Y() = aPos.Y() + 2;
+        pPageInfo->m_pExtPage->SetPosSizePixel( aPos, aSize );
+    }
 
-            if ( pTGInfo->m_pExtPage )
-            {
-                pTGInfo->m_pExtPage->Show();
-                pTGInfo->m_pExtPage->ActivatePage();
-            }
+    if ( pPageInfo->m_pPage )
+    {
+        if ( RID_SVXPAGE_COLOR != pPageInfo->m_nPageId &&
+             pPageInfo->m_pPage->HasExchangeSupport())
+        {
+            pPageInfo->m_pPage->ActivatePage(*pGroupInfo->m_pOutItemSet);
+        }
+        pPageInfo->m_pPage->Show();
+    }
+    else if ( pPageInfo->m_pExtPage )
+    {
+        pPageInfo->m_pExtPage->Show();
+        pPageInfo->m_pExtPage->ActivatePage();
+    }
 
-            pCurrentPageEntry = pEntry;
+    String sTmpTitle = sTitle;
+    sTmpTitle += String::CreateFromAscii(" - ");
+    sTmpTitle += aTreeLB.GetEntryText(pParent);
+    sTmpTitle += String::CreateFromAscii(" - ");
+    sTmpTitle += aTreeLB.GetEntryText(pEntry);
+    SetText(sTmpTitle);
+    pCurrentPageEntry = pEntry;
+    if ( !bForgetSelection )
+    {
+        if ( !pLastPageSaver )
+            pLastPageSaver = new LastPageSaver;
+        if ( !bIsFromExtensionManager )
+            pLastPageSaver->m_nLastPageId = pPageInfo->m_nPageId;
+        if ( pPageInfo->m_pExtPage )
+        {
+            if ( bIsFromExtensionManager )
+                pLastPageSaver->m_sLastPageURL_ExtMgr = pPageInfo->m_sPageURL;
+            else
+                pLastPageSaver->m_sLastPageURL_Tools = pPageInfo->m_sPageURL;
         }
     }
+    pNewPage = pPageInfo->m_pPage;
 
     // restore lost focus, if necessary
     Window* pFocusWin = Application::GetFocusWindow();
@@ -2207,10 +2058,6 @@ void OfaTreeOptionsDialog::ResizeTreeLB( void )
     MoveControl( aHelpPB, nDelta );
     MoveControl( aBackPB, nDelta );
     MoveControl( aHiddenGB, nDelta );
-    MoveControl( aPageTitleFT, nDelta );
-    MoveControl( aLine1FL, nDelta );
-    MoveControl( aHelpFT, nDelta );
-    MoveControl( aHelpImg, nDelta );
 }
 
 bool isNodeActive( OptionsNode* pNode, Module* pModule )
diff --git a/cui/source/options/treeopt.hrc b/cui/source/options/treeopt.hrc
index 88e9697..46572f4 100644
--- a/cui/source/options/treeopt.hrc
+++ b/cui/source/options/treeopt.hrc
@@ -32,18 +32,9 @@
 #define PB_HELP                 3
 #define PB_BACK                 4
 #define TLB_PAGES               5
-#define FT_HELPTEXT             6
-#define STR_HELPTEXTS           7
-#define IMG_LIST                8
-#define IMG_HELP                9
-#define FT_PAGE_TITLE           10
-#define FL_LINE_1               11
 
-#define BMP_ROOT_CLOSED         17
-#define BMP_ROOT_OPENED         18
 #define FB_BORDER               19
 
-#define IMG_HINT                20
 #define FT_HINT                 21
 #define CB_DISABLE              22
 #define BTN_HINT                23
@@ -62,15 +53,10 @@
 #define STR_SAVE_PAGE           (STR_GENERAL_PAGES_START + 9)
 #define STR_USERDATA_PAGE       (STR_GENERAL_PAGES_START + 10)
 
-#define FB_IMAGE                43
-
-
 // metrics
 
 #define WIDTH_PAGEFRAME         263
 #define HEIGHT_PAGEFRAME        191
-#define WIDTH_IMG_HELP          25
-#define HEIGHT_IMG_HELP         30
 
 #define COL_1                   (RSC_SP_DLG_INNERBORDER_LEFT)
 #define COL_2                   (COL_1+0)
@@ -85,16 +71,9 @@
 #define COL_5                   (COL_6-RSC_SP_CTRL_GROUP_X)
 #define COL_4                   (COL_5-RSC_CD_PUSHBUTTON_WIDTH)
 #define COL_3_1                 (COL_3+RSC_SP_TBPG_INNERBORDER_LEFT)
-#define COL_3_3                 (COL_3_1+WIDTH_IMG_HELP)
-#define COL_3_5                 (COL_11-RSC_SP_TBPG_INNERBORDER_RIGHT)
 
 #define ROW_1                   (RSC_SP_DLG_INNERBORDER_TOP)
 #define ROW_2                   (ROW_1+HEIGHT_PAGEFRAME)
 #define ROW_3                   (ROW_2+RSC_SP_CTRL_GROUP_Y)
 #define ROW_4                   (ROW_3+RSC_CD_PUSHBUTTON_HEIGHT)
 #define ROW_5                   (ROW_4+RSC_SP_DLG_INNERBORDER_BOTTOM)
-#define ROW_1_1                 (ROW_1+2)
-#define ROW_1_2                 (ROW_1+12)
-#define ROW_1_3                 (ROW_1_1+HEIGHT_IMG_HELP+2)
-#define ROW_1_4                 (ROW_1_3+8)
-
diff --git a/cui/source/options/treeopt.src b/cui/source/options/treeopt.src
index 93ea0c2..9e4fdeb 100644
--- a/cui/source/options/treeopt.src
+++ b/cui/source/options/treeopt.src
@@ -83,62 +83,10 @@ ModalDialog RID_OFADLG_OPTIONS_TREE
         Size = MAP_APPFONT ( WIDTH_PAGEFRAME, HEIGHT_PAGEFRAME ) ;
         Hide = TRUE;
     };
-    FixedImage IMG_HELP
-    {
-        Pos = MAP_APPFONT ( COL_3_1, ROW_1_1 ) ;
-        Size = MAP_APPFONT ( WIDTH_IMG_HELP, HEIGHT_IMG_HELP ) ;
-        Hide = TRUE;
-    };
-    FixedText FT_PAGE_TITLE
-    {
-        Pos = MAP_APPFONT ( COL_3_3, ROW_1_2 ) ;
-        Size = MAP_APPFONT ( (COL_3_5-COL_3_3), 15 ) ;
-        Hide = TRUE;
-    };
-    FixedLine FL_LINE_1
-    {
-        Pos = MAP_APPFONT ( COL_3_1 , ROW_1_3 ) ;
-        Size = MAP_APPFONT ( (COL_3_5-COL_3_1), 1 ) ;
-        Comment = "Trennlinie" ;
-        Hide = TRUE;
-    };
-    FixedText FT_HELPTEXT
-    {
-        Pos = MAP_APPFONT ( COL_3_3, ROW_1_4 ) ;
-        Size = MAP_APPFONT ( (COL_3_5-COL_3_3), (HEIGHT_PAGEFRAME-ROW_1_4-1) ) ;
-        WordBreak = TRUE;
-        Hide = TRUE;
-    };
     String ST_LOAD_ERROR
     {
         Text [ en-US ] = "The selected module could not be loaded.";
     };
-    StringArray STR_HELPTEXTS
-    {
-        ItemList [ en-US ] =
-        {
-            < "This dialog is used to define general settings when working with %PRODUCTNAME. 
Enter your personal data, the defaults to be used when saving documents, and paths to important 
files. These settings will be saved automatically and used in later sessions as well."; 
SID_GENERAL_OPTIONS; > ;
-            < "This is where you make settings concerning language and writing aids for your work 
with %PRODUCTNAME."; SID_LANGUAGE_OPTIONS; > ;
-            < "This is where you configure %PRODUCTNAME for the Internet. You can save your proxy 
settings." ; SID_INET_DLG; > ;
-            < "This is where you specify various settings for text documents. These settings 
determine how your text documents are handled in %PRODUCTNAME and are valid for all new 
%PRODUCTNAME Writer documents. You can also define a few settings for the active text document if 
you save it afterwards." ; SID_SW_EDITOPTIONS; > ;
-            < "This is where you define the basic settings for %PRODUCTNAME documents in HTML 
format. For example, you decide which contents should be displayed on the screen or printed, how 
the pages are scrolled on the screen, in which color keywords are highlighted in the source text 
and much more." ; SID_SW_ONLINEOPTIONS; > ;
-            < "This is where you define various global settings for spreadsheets. For example, you 
can define which contents should be displayed and in which direction the cursor will move after you 
enter data in a cell. You also define sort lists, the number of the decimal places displayed, etc." 
; SID_SC_EDITOPTIONS; > ;
-            < "This is where you define the settings that apply to all newly saved presentations. 
Among other things, you decide which contents are displayed on the slides, which default unit of 
measure is used, if and how grid alignment is used, and if notes and handouts are always printed." 
; SID_SD_EDITOPTIONS; > ;
-            < "This is where you define the settings for drawing documents. Among other things, 
you determine which contents are displayed on the pages, which scale is used, if and how grid 
alignment is used, and which contents are printed by default." ; SID_SD_GRAPHIC_OPTIONS; > ;
-            < "This is where you select the print format and print options for all newly saved 
formula documents. These options take effect when you want to print a formula directly from 
%PRODUCTNAME Math." ; SID_SM_EDITOPTIONS; > ;
-            < "This is where you specify general default settings for your %PRODUCTNAME Charts. 
Set the colors you want for all new charts." ; SID_SCH_EDITOPTIONS; > ;
-            < "This is where you define general settings for accessing external data sources."; 
SID_SB_STARBASEOPTIONS; > ;
-            < "This is where you define general settings for opening and saving documents in 
external formats. You can control the behavior of macros or OLE objects in Microsoft Office 
documents or define settings for HTML documents." ; SID_FILTER_DLG; > ;
-        };
-    };
-    Bitmap BMP_ROOT_CLOSED
-    {
-        File = "plus.bmp" ;
-    };
-    Bitmap BMP_ROOT_OPENED
-    {
-        File = "minus.bmp" ;
-    };
 };
 
 Resource RID_OFADLG_OPTIONS_TREE_PAGES
@@ -303,33 +251,3 @@ String RID_RIDER_SLL_PERSONAL
 {
     Text [ en-US ] = "Personal certificates" ;
 };
-
-#define MASK_COL    MaskColor = Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } ;
-#define IMGLST_IDLST \
-    IdList = {                      \
-        SID_GENERAL_OPTIONS;        \
-        SID_LANGUAGE_OPTIONS;       \
-        SID_INET_DLG;               \
-        SID_SW_EDITOPTIONS;         \
-        SID_SW_ONLINEOPTIONS;       \
-        SID_SC_EDITOPTIONS;         \
-        SID_SD_EDITOPTIONS;         \
-        SID_SD_GRAPHIC_OPTIONS;     \
-        SID_SM_EDITOPTIONS;         \
-        SID_SCH_EDITOPTIONS;        \
-        SID_SB_STARBASEOPTIONS;     \
-        SID_FILTER_DLG;             \
-    };                              \
-    IdCount = {                     \
-        12;                         \
-    };
-
-ImageList RID_IMGLIST_TREEOPT
-{
-    Prefix = "tr";
-    MASK_COL
-    IMGLST_IDLST
-};
-
-
-
-- 
1.7.5.4

From 439ab52e978433d6b0457d566222d862ee32537e Mon Sep 17 00:00:00 2001
From: August Sodora <augsod@gmail.com>
Date: Fri, 16 Dec 2011 18:37:03 -0500
Subject: [PATCH 3/3] Clean up treeopt select handler locking hack

---
 cui/source/inc/treeopt.hxx        |    3 --
 cui/source/options/treeopt.cxx    |   58 +++++++++++++------------------------
 sw/source/ui/app/appopt.cxx       |    5 +--
 sw/source/ui/dialog/swdlgfact.cxx |    2 -
 4 files changed, 22 insertions(+), 46 deletions(-)

diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index c6ba402..b766320 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -177,14 +177,11 @@ private:
 
     sal_Bool        bForgetSelection;
     sal_Bool        bExternBrowserActive;
-    bool            bInSelectHdl_Impl;
     bool            bIsFromExtensionManager;
 
     // check "for the current document only" and set focus to "Western" languages box
     bool            bIsForSetDocumentLanguage;
 
-    Timer           aSelectTimer;
-
     com::sun::star::uno::Reference < com::sun::star::awt::XContainerWindowProvider >
                     m_xContainerWinProvider;
 
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index c07cf50..f41515f 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -149,9 +149,6 @@ using namespace ::com::sun::star::util;
     #define C2U(cChar)      rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( cChar ) )
 #endif
 
-#define HINT_TIMEOUT            200
-#define SELECT_FIRST_TIMEOUT    0
-#define SELECT_TIMEOUT          300
 #define EXPAND_PROTOCOL         "vnd.sun.star.expand:"
 
 LastPageSaver* OfaTreeOptionsDialog::pLastPageSaver = NULL;
@@ -365,7 +362,6 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, Window* pParent, const SfxItem
     return pRet;
 }
 
-
 struct OptionsMapping_Impl
 {
     const char* m_pGroupName;
@@ -534,7 +530,6 @@ struct OptionsGroupInfo
     pColorPageItemSet   ( NULL ),\
     mpColorPage         ( NULL ),\
     bForgetSelection    ( sal_False ),\
-    bInSelectHdl_Impl   ( false ),\
     bIsFromExtensionManager( false ), \
     bIsForSetDocumentLanguage( false )
 
@@ -667,14 +662,7 @@ sal_uInt16  OfaTreeOptionsDialog::AddGroup(const String& rGroupName,
 
 IMPL_LINK(OfaTreeOptionsDialog, ShowPageHdl_Impl, SvTreeListBox*, EMPTYARG)
 {
-    if ( aSelectTimer.GetTimeout() == SELECT_FIRST_TIMEOUT )
-    {
-        aSelectTimer.SetTimeout( SELECT_TIMEOUT );
-        SelectHdl_Impl( NULL );
-    }
-    else if ( aSelectTimer.GetTimeout() == SELECT_TIMEOUT )
-        aSelectTimer.Start();
-
+    SelectHdl_Impl( NULL );
     return 0;
 }
 
@@ -820,8 +808,6 @@ void OfaTreeOptionsDialog::InitTreeAndHandler()
     aOkPB.SetClickHdl( LINK( this, OfaTreeOptionsDialog, OKHdl_Impl ) );
 
     aHiddenGB.Show();
-    aSelectTimer.SetTimeout( SELECT_FIRST_TIMEOUT );
-    aSelectTimer.SetTimeoutHdl( LINK( this, OfaTreeOptionsDialog, SelectHdl_Impl ) );
 }
 
 void OfaTreeOptionsDialog::ActivatePage( sal_uInt16 nResId )
@@ -971,31 +957,25 @@ long    OfaTreeOptionsDialog::Notify( NotifyEvent& rNEvt )
 
 // --------------------------------------------------------------------
 
-class FlagSet_Impl
-{
-    bool & rFlag;
-    public:
-        FlagSet_Impl(bool& bFlag) : rFlag(bFlag){rFlag = true;}
-        ~FlagSet_Impl(){rFlag = false;}
-};
-
 IMPL_LINK( OfaTreeOptionsDialog, SelectHdl_Impl, Timer*, EMPTYARG )
 {
     SvTreeListBox* pBox = &aTreeLB;
-    SvLBoxEntry* pEntry = pBox->GetCurEntry();
-    SvLBoxEntry* pParent = pBox->GetParent(pEntry);
-    pBox->EndSelection();
 
-    DBG_ASSERT(!bInSelectHdl_Impl, "Timeout handler called twice");
-    if(bInSelectHdl_Impl || pCurrentPageEntry == pEntry)
+    if(pCurrentPageEntry == pBox->GetCurEntry())
+    {
+        pBox->EndSelection();
         return 0;
-    //#111938# lock the SelectHdl_Impl to prevent multiple executes
-    FlagSet_Impl aFlag(bInSelectHdl_Impl);
+    }
+
+    SvLBoxEntry* pEntry = pBox->GetCurEntry();
+    SvLBoxEntry* pParent = pBox->GetParent(pEntry);
 
     // If the user has selected a category, automatically switch to a suitable
     // default sub-page instead.
     if (!pParent)
     {
+        pBox->EndSelection();
+
         OptionsGroupInfo* pGroupInfo = static_cast<OptionsGroupInfo*>(pEntry->GetUserData());
 
         if(!pGroupInfo)
@@ -1047,6 +1027,8 @@ IMPL_LINK( OfaTreeOptionsDialog, SelectHdl_Impl, Timer*, EMPTYARG )
         return 0;
     }
 
+    pBox->EndSelection();
+
     TabPage* pOldPage = NULL;
     TabPage* pNewPage = NULL;
     OptionsPageInfo* pOptPageInfo = ( pCurrentPageEntry && aTreeLB.GetParent( pCurrentPageEntry ) )
@@ -1147,20 +1129,20 @@ IMPL_LINK( OfaTreeOptionsDialog, SelectHdl_Impl, Timer*, EMPTYARG )
                     pGroupInfo->m_pInItemSet->GetRanges());
         }
 
-        if(pGroupInfo->m_pModule)
-        {
-            pPageInfo->m_pPage = pGroupInfo->m_pModule->CreateTabPage(
-                pPageInfo->m_nPageId, this, *pGroupInfo->m_pInItemSet );
-        }
-        else if(RID_SVXPAGE_COLOR != pPageInfo->m_nPageId)
-            pPageInfo->m_pPage = ::CreateGeneralTabPage( pPageInfo->m_nPageId, this, 
*pGroupInfo->m_pInItemSet );
-        else
+        if(pPageInfo->m_nPageId == RID_SVXPAGE_COLOR)
         {
             pPageInfo->m_pPage = ::CreateGeneralTabPage(
                 pPageInfo->m_nPageId, this, *pColorPageItemSet );
             mpColorPage = (SvxColorTabPage*)pPageInfo->m_pPage;
             mpColorPage->SetupForViewFrame( SfxViewFrame::Current() );
         }
+        else
+        {
+            pPageInfo->m_pPage = ::CreateGeneralTabPage(pPageInfo->m_nPageId, this, 
*pGroupInfo->m_pInItemSet );
+
+            if(!pPageInfo->m_pPage && pGroupInfo->m_pModule)
+                pPageInfo->m_pPage = pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, 
this, *pGroupInfo->m_pInItemSet);
+        }
 
         DBG_ASSERT( pPageInfo->m_pPage, "tabpage could not created");
         if ( pPageInfo->m_pPage )
diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx
index 2221266..d9afcb3 100644
--- a/sw/source/ui/app/appopt.cxx
+++ b/sw/source/ui/app/appopt.cxx
@@ -526,7 +526,6 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI
             }
         }
         break;
-#if OSL_DEBUG_LEVEL > 1
         case  RID_SW_TP_OPTTEST_PAGE:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
@@ -538,7 +537,6 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI
             }
             break;
         }
-#endif
         case  RID_SW_TP_BACKGROUND:
         {
             SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
@@ -564,7 +562,8 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI
         break;
     }
 
-    OSL_ENSURE( pRet, "SwModule::CreateTabPage(): Unknown tabpage id" );
+    if(!pRet)
+        SAL_WARN( "sw", "SwModule::CreateTabPage(): Unknown tabpage id " << nId );
     return pRet;
 }
 
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index a31db0d..7a63661 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -1645,9 +1645,7 @@ CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 
nI
             break;
         case RID_SW_TP_OPTTEST_PAGE :
         case TP_OPTTEST_PAGE :
-#ifdef DBG_UTIL
             pRet = SwTestTabPage::Create;
-#endif
             break;
         case TP_OPTPRINT_PAGE :
         case RID_SW_TP_HTML_OPTPRINT_PAGE:
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.