[Libreoffice-commits] .: 9 commits - basctl/source cui/source desktop/source filter/source svx/source sw/inc sw/sdi sw/source sw/uiconfig vcl/inc vcl/source xmlsecurity/inc

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 9 03:41:16 PST 2013


 basctl/source/basicide/macrodlg.hxx                     |    2 
 cui/source/inc/SpellDialog.hxx                          |    2 
 cui/source/inc/hyphen.hxx                               |    2 
 cui/source/inc/scriptdlg.hxx                            |    2 
 desktop/source/deployment/gui/dp_gui_dialog2.hxx        |    2 
 filter/source/xsltdialog/xmlfiltersettingsdialog.hxx    |    2 
 filter/source/xsltdialog/xmlfiltertestdialog.hxx        |    2 
 svx/source/dialog/docrecovery.cxx                       |    2 
 svx/source/inc/docrecovery.hxx                          |    2 
 sw/inc/globals.hrc                                      |    4 
 sw/sdi/swriter.sdi                                      |    3 
 sw/source/ui/app/app.src                                |   10 
 sw/source/ui/inc/glossary.hxx                           |   63 -
 sw/source/ui/inc/misc.hrc                               |    2 
 sw/source/ui/inc/swuiidxmrk.hxx                         |    4 
 sw/source/ui/inc/unotools.hxx                           |   16 
 sw/source/ui/inc/wordcountdialog.hxx                    |    2 
 sw/source/ui/misc/glossary.cxx                          |  636 +++++++---------
 sw/source/ui/misc/glossary.hrc                          |   35 
 sw/source/ui/misc/glossary.src                          |  229 -----
 sw/source/ui/shells/textsh1.cxx                         |    5 
 sw/source/ui/uiview/view.hrc                            |    1 
 sw/source/ui/uiview/view.src                            |    4 
 sw/source/ui/uiview/view2.cxx                           |    2 
 sw/source/ui/utlui/unotools.cxx                         |   90 +-
 sw/uiconfig/swriter/ui/autotext.ui                      |  556 ++++++++-----
 vcl/inc/vcl/button.hxx                                  |    7 
 vcl/inc/vcl/layout.hxx                                  |   44 +
 vcl/inc/vcl/menu.hxx                                    |   12 
 vcl/inc/vcl/menubtn.hxx                                 |    1 
 vcl/source/control/button.cxx                           |    7 
 vcl/source/control/menubtn.cxx                          |    6 
 vcl/source/window/builder.cxx                           |    6 
 vcl/source/window/layout.cxx                            |   49 +
 vcl/source/window/menu.cxx                              |   12 
 xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx |    2 
 36 files changed, 926 insertions(+), 900 deletions(-)

New commits:
commit 9453d3d484c5410be81bae8ff89b492d7cf92052
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 9 11:27:34 2013 +0000

    always show preview in autotext dialog
    
    Change-Id: I4fe95db707cdaafb220435f281cce88284afd26d

diff --git a/sw/source/ui/inc/glossary.hxx b/sw/source/ui/inc/glossary.hxx
index 94b4ce5..42240e15 100644
--- a/sw/source/ui/inc/glossary.hxx
+++ b/sw/source/ui/inc/glossary.hxx
@@ -93,8 +93,6 @@ class SwGlossaryDlg : public SvxStandardDialog
     CheckBox*       m_pFileRelCB;
     CheckBox*       m_pNetRelCB;
     Window*         m_pExampleWIN;
-    Window*         m_pExampleDummyWIN;
-    CheckBox*       m_pShowExampleCB;
     PushButton*     m_pInsertBtn;
     CloseButton*    m_pCloseBtn;
     MenuButton*     m_pEditBtn;
@@ -121,6 +119,7 @@ class SwGlossaryDlg : public SvxStandardDialog
     SwWrtShell*     pSh;
 
     void EnableShortName(sal_Bool bOn = sal_True);
+    void ShowPreview();
 
     DECL_LINK( NameModify, Edit * );
     DECL_LINK( NameDoubleClick, SvTreeListBox * );
@@ -132,7 +131,6 @@ class SwGlossaryDlg : public SvxStandardDialog
     DECL_LINK(InsertHdl, void *);
     DECL_LINK( PathHdl, Button * );
     DECL_LINK( CheckBoxHdl, CheckBox * );
-    DECL_LINK( ShowPreviewHdl, CheckBox * );
     DECL_LINK( PreviewLoadedHdl, void * );
 
 
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 140fea7..be6adaa 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -206,12 +206,10 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
     get(m_pCategoryBox, "category");
     get(m_pFileRelCB, "relfile");
     get(m_pNetRelCB, "relnet");
-    get(m_pShowExampleCB, "showpreview");
     get(m_pInsertBtn, "insert");
     get(m_pBibBtn, "categories");
     get(m_pPathBtn, "path");
     get(m_pExampleWIN, "example");
-    get(m_pExampleDummyWIN, "dummy");
     get(m_pEditBtn, "autotext");
 
     SvtLinguConfig aLocalLinguConfig;
@@ -233,14 +231,10 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
     m_pCategoryBox->SetDoubleClickHdl(LINK(this,SwGlossaryDlg, NameDoubleClick));
     m_pCategoryBox->SetSelectHdl(LINK(this,SwGlossaryDlg,GrpSelect));
     m_pBibBtn->SetClickHdl(LINK(this,SwGlossaryDlg,BibHdl));
-    m_pShowExampleCB->SetClickHdl(LINK(this, SwGlossaryDlg, ShowPreviewHdl));
 
     m_pInsertBtn->SetClickHdl(LINK(this,SwGlossaryDlg,InsertHdl));
 
-    const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
-
-    m_pShowExampleCB->Check( rCfg.IsAutoTextPreview());
-    ShowPreviewHdl(m_pShowExampleCB);
+    ShowPreview();
 
     bIsDocReadOnly = pSh->GetView().GetDocShell()->IsReadOnly() ||
                       pSh->HasReadonlySel();
@@ -260,9 +254,6 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
 
 SwGlossaryDlg::~SwGlossaryDlg()
 {
-    SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
-    rCfg.SetAutoTextPreview(m_pShowExampleCB->IsChecked()) ;
-
     m_pCategoryBox->Clear();
     delete pExampleFrame;
 }
@@ -1125,35 +1116,22 @@ IMPL_LINK_NOARG(SwGlossaryDlg, InsertHdl)
     return 0;
 }
 
-IMPL_LINK( SwGlossaryDlg, ShowPreviewHdl, CheckBox *, pBox )
+void SwGlossaryDlg::ShowPreview()
 {
-    sal_Bool bCreated = sal_False;
-    if(pBox->IsChecked())
+    //create example
+    if (!pExampleFrame)
     {
-        //create example
-        if(!pExampleFrame)
-        {
-            Link aLink(LINK(this, SwGlossaryDlg, PreviewLoadedHdl));
-            pExampleFrame = new SwOneExampleFrame( *m_pExampleWIN,
-                            EX_SHOW_ONLINE_LAYOUT, &aLink );
-            bCreated = sal_True;
-        }
+        Link aLink(LINK(this, SwGlossaryDlg, PreviewLoadedHdl));
+        pExampleFrame = new SwOneExampleFrame( *m_pExampleWIN,
+                        EX_SHOW_ONLINE_LAYOUT, &aLink );
     }
 
-    sal_Bool bShow = pBox->IsChecked() && !bCreated;
-    m_pExampleWIN->Show( bShow );
-    m_pExampleDummyWIN->Show(!bShow);
-    if( ::GetCurrGlosGroup() )
+    if (::GetCurrGlosGroup())
         ShowAutoText(*::GetCurrGlosGroup(), m_pShortNameEdit->GetText());
-
-    return 0;
 };
 
 IMPL_LINK_NOARG(SwGlossaryDlg, PreviewLoadedHdl)
 {
-    sal_Bool bShow = m_pShowExampleCB->IsChecked();
-    m_pExampleWIN->Show( bShow );
-    m_pExampleDummyWIN->Show(!bShow);
     ResumeShowAutoText();
     return 0;
 }
commit 7e2b1e9218b194ba244dfa23089ec30fd978f3de
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 9 11:25:31 2013 +0000

    implement a VclEventBox akin to GtkEventBox and map
    
    rework EventBox to inherit from VclBin and rebase SwFrmCtrlWindow on top of it
    
    Change-Id: I25f037b33bf244d3d39f57bfe11cabfaf992bf1c

diff --git a/sw/source/ui/inc/unotools.hxx b/sw/source/ui/inc/unotools.hxx
index f82d541..8d4e31a 100644
--- a/sw/source/ui/inc/unotools.hxx
+++ b/sw/source/ui/inc/unotools.hxx
@@ -20,10 +20,11 @@
 #define _UNOTOOLS_HXX
 
 
+#include <vcl/button.hxx>
+#include <vcl/edit.hxx>
 #include <vcl/dialog.hxx>
 #include <vcl/fixed.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/button.hxx>
+#include <vcl/layout.hxx>
 #include <actctrl.hxx>
 #include <com/sun/star/frame/XController.hpp>
 #include <com/sun/star/text/XTextCursor.hpp>
@@ -35,46 +36,11 @@
 
 class SwOneExampleFrame;
 
-//Any Commands an EventBoxHelper receives
-//are forwarded to its parent
-class EventBoxHelper : public Window
-{
-public:
-    EventBoxHelper(Window* pParent)
-        : Window(pParent, 0)
-    {
-        SetPaintTransparent(true);
-        SetSizePixel(pParent->GetSizePixel());
-        Show();
-    }
-    virtual void Command(const CommandEvent& rCEvt)
-    {
-        GetParent()->Command(rCEvt);
-    }
-};
-
-//Enforces that it is always the same size
-//as its parent. Any Commands it receives
-//it forwards to its parent
-class EventBox : public Window
-{
-private:
-    EventBoxHelper m_aEventBoxHelper;
-public:
-    EventBox(Window* pParent, WinBits nBits)
-        : Window(pParent, nBits)
-        , m_aEventBoxHelper(this)
-    {
-    }
-    virtual void Command( const CommandEvent& rCEvt ) = 0;
-    virtual void Resize();
-};
-
-class SwFrmCtrlWindow : public EventBox
+class SwFrmCtrlWindow : public VclEventBox
 {
-    SwOneExampleFrame*  pExampleFrame;
+    SwOneExampleFrame* pExampleFrame;
 public:
-    SwFrmCtrlWindow(Window* pParent, WinBits nBits, SwOneExampleFrame*  pFrame);
+    SwFrmCtrlWindow(Window* pParent, SwOneExampleFrame* pFrame);
 
     virtual void Command( const CommandEvent& rCEvt );
     virtual Size GetOptimalSize(WindowSizeType eType) const;
diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index 7ee6d32..19933c3 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -65,7 +65,7 @@ SwOneExampleFrame::SwOneExampleFrame( Window& rWin,
                                         sal_uInt32 nFlags,
                                         const Link* pInitializedLink,
                                         String* pURL ) :
-    aTopWindow(&rWin, 0, this),
+    aTopWindow(&rWin, this),
     aMenuRes(SW_RES(RES_FRMEX_MENU)),
     pModuleView(SW_MOD()->GetView()),
     nStyleFlags(nFlags),
@@ -75,7 +75,6 @@ SwOneExampleFrame::SwOneExampleFrame( Window& rWin,
     if (pURL && pURL->Len())
         sArgumentURL = *pURL;
 
-    aTopWindow.SetPaintTransparent(sal_True);
     aTopWindow.SetPosSizePixel(Point(0, 0), rWin.GetSizePixel());
 
     if( pInitializedLink )
@@ -366,7 +365,6 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
 
         uno::Reference< awt::XWindow >  xWin( _xControl, uno::UNO_QUERY );
         Size aWinSize(aTopWindow.GetOutputSizePixel());
-        fprintf(stderr, "size %ld %ld\n", aWinSize.Width(), aWinSize.Height());
         xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
 
         // can only be done here - the SFX changes the ScrollBar values
@@ -517,10 +515,9 @@ IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu )
     return 0;
 };
 
-SwFrmCtrlWindow::SwFrmCtrlWindow(Window* pParent, WinBits nBits,
-                                SwOneExampleFrame*  pFrame) :
-    EventBox(pParent, nBits),
-    pExampleFrame(pFrame)
+SwFrmCtrlWindow::SwFrmCtrlWindow(Window* pParent, SwOneExampleFrame* pFrame)
+    : VclEventBox(pParent)
+    , pExampleFrame(pFrame)
 {
     set_expand(true);
     set_fill(true);
@@ -528,8 +525,6 @@ SwFrmCtrlWindow::SwFrmCtrlWindow(Window* pParent, WinBits nBits,
 
 void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt )
 {
-    fprintf(stderr, "SwFrmCtrlWindow::Command\n");
-
     switch ( rCEvt.GetCommand() )
     {
         case COMMAND_CONTEXTMENU:
@@ -547,27 +542,16 @@ void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt )
     }
 }
 
-void EventBox::Resize()
-{
-    fprintf(stderr, "EventBox::Resize\n");
-    Size aSize(GetSizePixel());
-    for (Window *pChild = GetWindow(WINDOW_FIRSTCHILD); pChild; pChild = pChild->GetWindow(WINDOW_NEXT))
-    {
-        pChild->SetSizePixel(aSize);
-        fprintf(stderr, "child %p\n", pChild);
-    }
-}
-
 Size SwFrmCtrlWindow::GetOptimalSize(WindowSizeType eType) const
 {
     if (eType == WINDOWSIZE_PREFERRED)
         return LogicToPixel(Size(82, 124), MapMode(MAP_APPFONT));
-    return Window::GetOptimalSize(eType);
+    return VclEventBox::GetOptimalSize(eType);
 }
 
 void SwFrmCtrlWindow::Resize()
 {
-    EventBox::Resize();
+    VclEventBox::Resize();
     pExampleFrame->ClearDocument(true);
 }
 
diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx
index d9c5e63..9beee36 100644
--- a/vcl/inc/vcl/layout.hxx
+++ b/vcl/inc/vcl/layout.hxx
@@ -529,6 +529,50 @@ private:
     ScrollBar m_aHScroll;
 };
 
+//Enforces that its children are always the same size as itself.
+//Intercepts any Commands intended for its children.
+//
+//by default the Commands are discarded, inherit from this
+//and implement "Command" to get them
+class VCL_DLLPUBLIC VclEventBox : public VclBin
+{
+private:
+    //Any Commands an EventBoxHelper receives are forwarded to its parent
+    //The VclEventBox ensures that m_aEventBoxHelper is the
+    //first child and is transparent, but covers the rest of the children
+    class EventBoxHelper : public Window
+    {
+    public:
+        EventBoxHelper(Window* pParent)
+            : Window(pParent, 0)
+        {
+            SetSizePixel(pParent->GetSizePixel());
+            EnableChildTransparentMode();
+            SetPaintTransparent(true);
+            SetBackground();
+        }
+        virtual void Command(const CommandEvent& rCEvt)
+        {
+            GetParent()->Command(rCEvt);
+        }
+    };
+
+    EventBoxHelper m_aEventBoxHelper;
+public:
+    VclEventBox(Window* pParent)
+        : VclBin(pParent)
+        , m_aEventBoxHelper(this)
+    {
+        m_aEventBoxHelper.Show();
+    }
+    virtual Window *get_child();
+    virtual const Window *get_child() const;
+    virtual Size calculateRequisition() const;
+    virtual void setAllocation(const Size &rAllocation);
+
+    virtual void Command(const CommandEvent& rCEvt);
+};
+
 // retro-fitting utilities //
 
 //Get a Size which is large enough to contain all children with
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 5e6fc5c..1873198 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -937,6 +937,10 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
     {
         pWindow = new VclScrolledWindow(pParent);
     }
+    else if (name == "GtkEventBox")
+    {
+        pWindow = new VclEventBox(pParent);
+    }
     else if (name == "GtkEntry")
     {
         pWindow = new Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK);
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 0b01c6a..6a071b1 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -17,7 +17,7 @@ VclContainer::VclContainer(Window *pParent, WinBits nStyle)
 {
     ImplInit(pParent, nStyle, NULL);
     EnableChildTransparentMode();
-    SetPaintTransparent(sal_True);
+    SetPaintTransparent(true);
     SetBackground();
 }
 
@@ -1331,6 +1331,53 @@ bool VclScrolledWindow::set_property(const rtl::OString &rKey, const rtl::OStrin
     return bRet;
 }
 
+const Window *VclEventBox::get_child() const
+{
+    const WindowImpl* pWindowImpl = ImplGetWindowImpl();
+
+    assert(pWindowImpl->mpFirstChild == &m_aEventBoxHelper);
+
+    return pWindowImpl->mpFirstChild->GetWindow(WINDOW_NEXT);
+}
+
+Window *VclEventBox::get_child()
+{
+    return const_cast<Window*>(const_cast<const VclEventBox*>(this)->get_child());
+}
+
+void VclEventBox::setAllocation(const Size& rAllocation)
+{
+    Point aChildPos(0, 0);
+    for (Window *pChild = GetWindow(WINDOW_FIRSTCHILD); pChild; pChild = pChild->GetWindow(WINDOW_NEXT))
+    {
+        if (!pChild->IsVisible())
+            continue;
+        setLayoutAllocation(*pChild, aChildPos, rAllocation);
+    }
+}
+
+Size VclEventBox::calculateRequisition() const
+{
+    Size aRet(0, 0);
+
+    for (const Window* pChild = get_child(); pChild;
+        pChild = pChild->GetWindow(WINDOW_NEXT))
+    {
+        if (!pChild->IsVisible())
+            continue;
+        Size aChildSize = getLayoutRequisition(*pChild);
+        aRet.Width() = std::max(aRet.Width(), aChildSize.Width());
+        aRet.Height() = std::max(aRet.Height(), aChildSize.Height());
+    }
+
+    return aRet;
+}
+
+void VclEventBox::Command(const CommandEvent&)
+{
+    //discard events by default to block them reaching children
+}
+
 Size getLegacyBestSizeForChildren(const Window &rWindow)
 {
     Rectangle aBounds;
commit 397722b55e06223377f812e29f3b51d997b837f5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 9 09:49:13 2013 +0000

    workaround bizarre horizontal-scrollbar enable logic
    
    when we really want no horizontal scrollbar, and
    want to be in online layout mode for previews
    
    Change-Id: I2d0e279a6f112ad7edbd6b523ea07b6dd2061ebc

diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index 8a18caf..7ee6d32 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -168,6 +168,31 @@ void    SwOneExampleFrame::DisposeControl()
     _xController = 0;
 }
 
+static void disableScrollBars(uno::Reference< beans::XPropertySet > xViewProps,
+    bool bEnableOnlineMode)
+{
+    //the scrollbar logic is kind of busted looking in writer, when the hori scrollbar
+    //property is changed then the hori scrollbar is enabled if the property is
+    //true or browse (online) mode is enabled. So...
+    //disable online mode
+    //turn off scrollbars
+    //turn back on online mode if that's what we want
+    //which subverts the (dodgy/buggy) scrollbar setting
+    //
+    //To reproduce this problem, in edit->autotext and click through
+    //the examples and see if the preview gets a horizontal scrollbar
+    uno::Any aFalseSet(uno::makeAny(sal_False));
+    xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_ONLINE_LAYOUT)), aFalseSet);
+
+    xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_SCROLL_BAR )), aFalseSet);
+    xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_SCROLL_BAR )), aFalseSet);
+
+    if (bEnableOnlineMode)
+    {
+        xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_ONLINE_LAYOUT)), uno::makeAny(sal_True));
+    }
+}
+
 IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
 {
     if(!_xControl.is())
@@ -245,9 +270,9 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
                 aZoom <<= nZoomValue;
                 xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
             }
-            // set onlinelayout property behind setting the zoom
-            xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_ONLINE_LAYOUT)),
-                    (nStyleFlags&EX_SHOW_ONLINE_LAYOUT) ? aTrueSet : aFalseSet );
+
+            // set onlinelayout property after setting the zoom
+            disableScrollBars(xViewProps, nStyleFlags&EX_SHOW_ONLINE_LAYOUT);
             bIsInitialized = sal_True;
         }
 
@@ -255,7 +280,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
         uno::Reference< text::XText >  xText = xDoc->getText();
         _xCursor = xText->createTextCursor();
 
-        //From here, a cursor is defined, which goes trough the template,
+        //From here, a cursor is defined, which goes through the template,
         //and overwrites the template words where it is necessary.
 
         uno::Reference< lang::XUnoTunnel> xTunnel( _xCursor, uno::UNO_QUERY);
@@ -345,8 +370,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
         xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
 
         // can only be done here - the SFX changes the ScrollBar values
-        xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_SCROLL_BAR )), aFalseSet);
-        xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_SCROLL_BAR )), aFalseSet);
+        disableScrollBars(xViewProps, nStyleFlags&EX_SHOW_ONLINE_LAYOUT);
 
         if (aInitializedLink.IsSet())
             aInitializedLink.Call(this);
commit f5391df4548789acf71a45550742a2d3bbb3b7e4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 8 15:05:55 2013 +0000

    rework unotools doc previewer
    
    split the very opaque SwFrmCtrlWindow into an
    EventBox which works like GtkEventBox, this
    a) contains a EventBoxHelper window which EventBox ensures is
       its first child
    b) EventBox ensures that all its children are the same size
       as the EventBox
    c) The EventBoxHelper is transparent and in front of the
       rest of the children, so its intercepts all commands
    d) EventBoxHelper forwards command to the EventBox
    
    so you can inherit from EventBox and stick a child in there
    and the upshot is that the child doesn't get Commands, but
    the class inherited from EventBox gets them instead
    
    Change-Id: I783cd6bbd194e28a1744147e8175cba7895158be

diff --git a/sw/source/ui/inc/unotools.hxx b/sw/source/ui/inc/unotools.hxx
index e643525..f82d541 100644
--- a/sw/source/ui/inc/unotools.hxx
+++ b/sw/source/ui/inc/unotools.hxx
@@ -35,13 +35,50 @@
 
 class SwOneExampleFrame;
 
-class SwFrmCtrlWindow : public Window
+//Any Commands an EventBoxHelper receives
+//are forwarded to its parent
+class EventBoxHelper : public Window
+{
+public:
+    EventBoxHelper(Window* pParent)
+        : Window(pParent, 0)
+    {
+        SetPaintTransparent(true);
+        SetSizePixel(pParent->GetSizePixel());
+        Show();
+    }
+    virtual void Command(const CommandEvent& rCEvt)
+    {
+        GetParent()->Command(rCEvt);
+    }
+};
+
+//Enforces that it is always the same size
+//as its parent. Any Commands it receives
+//it forwards to its parent
+class EventBox : public Window
+{
+private:
+    EventBoxHelper m_aEventBoxHelper;
+public:
+    EventBox(Window* pParent, WinBits nBits)
+        : Window(pParent, nBits)
+        , m_aEventBoxHelper(this)
+    {
+    }
+    virtual void Command( const CommandEvent& rCEvt ) = 0;
+    virtual void Resize();
+};
+
+class SwFrmCtrlWindow : public EventBox
 {
     SwOneExampleFrame*  pExampleFrame;
 public:
     SwFrmCtrlWindow(Window* pParent, WinBits nBits, SwOneExampleFrame*  pFrame);
 
-    virtual void    Command( const CommandEvent& rCEvt );
+    virtual void Command( const CommandEvent& rCEvt );
+    virtual Size GetOptimalSize(WindowSizeType eType) const;
+    virtual void Resize();
 };
 
 class MenuResource : public Resource
@@ -71,7 +108,6 @@ class SW_DLLPUBLIC SwOneExampleFrame
     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor >     _xCursor;
 
     SwFrmCtrlWindow aTopWindow;
-    Window&         rWindow;
     Timer           aLoadedTimer;
     Link            aInitializedLink;
 
diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index 86c0f3f..8a18caf 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -65,20 +65,18 @@ SwOneExampleFrame::SwOneExampleFrame( Window& rWin,
                                         sal_uInt32 nFlags,
                                         const Link* pInitializedLink,
                                         String* pURL ) :
-    aTopWindow( rWin.GetParent(), 0, this ),
-    rWindow(rWin),
+    aTopWindow(&rWin, 0, this),
     aMenuRes(SW_RES(RES_FRMEX_MENU)),
     pModuleView(SW_MOD()->GetView()),
     nStyleFlags(nFlags),
     bIsInitialized(sal_False),
     bServiceAvailable(sal_False)
 {
-    if(pURL && pURL->Len())
+    if (pURL && pURL->Len())
         sArgumentURL = *pURL;
 
     aTopWindow.SetPaintTransparent(sal_True);
-    aTopWindow.SetPosSizePixel(rWin.GetPosPixel(), rWin.GetSizePixel());
-    aTopWindow.SetZOrder( &rWin, WINDOW_ZORDER_FIRST );
+    aTopWindow.SetPosSizePixel(Point(0, 0), rWin.GetSizePixel());
 
     if( pInitializedLink )
         aInitializedLink = *pInitializedLink;
@@ -87,7 +85,6 @@ SwOneExampleFrame::SwOneExampleFrame( Window& rWin,
     aLoadedTimer.SetTimeoutHdl(LINK(this, SwOneExampleFrame, TimeoutHdl));
     aLoadedTimer.SetTimeout(200);
 
-    rWin.Enable(sal_False);
     CreateControl();
 
     aTopWindow.Show();
@@ -109,7 +106,7 @@ SwOneExampleFrame::~SwOneExampleFrame()
     DisposeControl();
 }
 
-void    SwOneExampleFrame::CreateControl()
+void SwOneExampleFrame::CreateControl()
 {
     if(_xControl.is())
         return ;
@@ -120,15 +117,15 @@ void    SwOneExampleFrame::CreateControl()
     _xControl = uno::Reference< awt::XControl >(xInst, uno::UNO_QUERY);
     if(_xControl.is())
     {
-        uno::Reference< awt::XWindowPeer >  xParent( rWindow.GetComponentInterface() );
+        uno::Reference< awt::XWindowPeer >  xParent( aTopWindow.GetComponentInterface() );
 
         uno::Reference< awt::XToolkit >  xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW );
 
         _xControl->createPeer( xToolkit, xParent );
 
         uno::Reference< awt::XWindow >  xWin( _xControl, uno::UNO_QUERY );
-        xWin->setVisible( sal_False );
-        Size aWinSize(rWindow.GetOutputSizePixel());
+        xWin->setVisible(sal_False);
+        Size aWinSize(aTopWindow.GetOutputSizePixel());
         xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
 
         uno::Reference< beans::XPropertySet >  xPrSet(xInst, uno::UNO_QUERY);
@@ -342,24 +339,25 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
             xPProp->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RIGHT_MARGIN)), aZero);
         }
 
+        uno::Reference< awt::XWindow >  xWin( _xControl, uno::UNO_QUERY );
+        Size aWinSize(aTopWindow.GetOutputSizePixel());
+        fprintf(stderr, "size %ld %ld\n", aWinSize.Width(), aWinSize.Height());
+        xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
+
         // can only be done here - the SFX changes the ScrollBar values
         xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_SCROLL_BAR )), aFalseSet);
         xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_SCROLL_BAR )), aFalseSet);
 
-        if( aInitializedLink.IsSet() )
-        {
-            rWindow.Enable(sal_False, sal_True);
-               aInitializedLink.Call(this);
-        }
+        if (aInitializedLink.IsSet())
+            aInitializedLink.Call(this);
 
         uno::Reference< text::XTextViewCursorSupplier >  xCrsrSupp(_xController, uno::UNO_QUERY);
         uno::Reference< view::XScreenCursor >  xScrCrsr(xCrsrSupp->getViewCursor(), uno::UNO_QUERY);
         if(xScrCrsr.is())
             xScrCrsr->screenUp();
 
-        uno::Reference< awt::XWindow >  xWin( _xControl, uno::UNO_QUERY );
         xWin->setVisible( sal_True );
-        rWindow.Show();
+        aTopWindow.Show();
 
         if( xTunnel.is() )
         {
@@ -497,13 +495,17 @@ IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu )
 
 SwFrmCtrlWindow::SwFrmCtrlWindow(Window* pParent, WinBits nBits,
                                 SwOneExampleFrame*  pFrame) :
-    Window(pParent, nBits),
+    EventBox(pParent, nBits),
     pExampleFrame(pFrame)
 {
+    set_expand(true);
+    set_fill(true);
 }
 
 void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt )
 {
+    fprintf(stderr, "SwFrmCtrlWindow::Command\n");
+
     switch ( rCEvt.GetCommand() )
     {
         case COMMAND_CONTEXTMENU:
@@ -521,6 +523,30 @@ void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt )
     }
 }
 
+void EventBox::Resize()
+{
+    fprintf(stderr, "EventBox::Resize\n");
+    Size aSize(GetSizePixel());
+    for (Window *pChild = GetWindow(WINDOW_FIRSTCHILD); pChild; pChild = pChild->GetWindow(WINDOW_NEXT))
+    {
+        pChild->SetSizePixel(aSize);
+        fprintf(stderr, "child %p\n", pChild);
+    }
+}
+
+Size SwFrmCtrlWindow::GetOptimalSize(WindowSizeType eType) const
+{
+    if (eType == WINDOWSIZE_PREFERRED)
+        return LogicToPixel(Size(82, 124), MapMode(MAP_APPFONT));
+    return Window::GetOptimalSize(eType);
+}
+
+void SwFrmCtrlWindow::Resize()
+{
+    EventBox::Resize();
+    pExampleFrame->ClearDocument(true);
+}
+
 MenuResource::MenuResource(const ResId& rResId) :
     Resource(rResId),
     aMenuArray(ResId(1,*rResId.GetResMgr()))
commit e3ee30f028d449dbad342b18ae26f71f571a8dbd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 7 16:58:29 2013 +0000

    adapt code to .ui autotext dialog
    
    Change-Id: I34fe1d6ab2e36b3c3e7e9199872c56aff184bf66

diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc
index 2d87edf..66c2134 100644
--- a/sw/inc/globals.hrc
+++ b/sw/inc/globals.hrc
@@ -74,6 +74,10 @@
 #define STR_CAPTION_ABOVE           (RC_GLOBALS_BEGIN + 44)
 #define STR_CAPTION_BELOW           (RC_GLOBALS_BEGIN + 45)
 
+#define SW_STR_READONLY             (RC_GLOBALS_BEGIN + 46)
+
+#define STR_READONLY_PATH           (RC_GLOBALS_BEGIN + 47)
+
 // DIALOGS -----------------------------------------------------------
 
 #define DLG_THESAURUS               (RC_GLOBALS_BEGIN + 2)
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index 0d27c8e..a7faf17 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -261,6 +261,16 @@ String STR_CAPTION_BELOW
     Text [ en-US ] = "Below" ;
 };
 
+String SW_STR_READONLY
+{
+    Text [ en-US ] = "read-only" ;
+};
+
+String STR_READONLY_PATH
+{
+    Text [ en-US ] = "The 'AutoText' directories are read-only. Do you want to call the path settings dialog?";
+};
+
 InfoBox MSG_ERROR_SEND_MAIL
 {
     BUTTONS = WB_OK ;
diff --git a/sw/source/ui/inc/glossary.hxx b/sw/source/ui/inc/glossary.hxx
index 6d8d37e..94b4ce5 100644
--- a/sw/source/ui/inc/glossary.hxx
+++ b/sw/source/ui/inc/glossary.hxx
@@ -71,9 +71,11 @@ class SwGlTreeListBox : public SvTreeListBox
                                     sal_uLong&        rNewChildPos);
 public:
     SwGlTreeListBox(Window* pParent, const ResId& rResId);
+    SwGlTreeListBox(Window* pParent, WinBits nBits);
 
-    virtual void    RequestHelp( const HelpEvent& rHEvt );
-    void            Clear();
+    virtual void RequestHelp( const HelpEvent& rHEvt );
+    virtual Size GetOptimalSize(WindowSizeType eType) const;
+    void Clear();
 };
 
 //------------------------------------------------------------------
@@ -83,31 +85,27 @@ class SwGlossaryDlg : public SvxStandardDialog
     friend class SwNewGlosNameDlg;
     friend class SwGlTreeListBox;
 
-    CheckBox        aInsertTipCB;
-    FixedText       aNameLbl;
-    Edit            aNameED;
-    FixedText       aShortNameLbl;
-    NoSpaceEdit     aShortNameEdit;
-    SwGlTreeListBox aCategoryBox;
-    FixedLine       aRelativeFL;
-    CheckBox        aFileRelCB;
-    CheckBox        aNetRelCB;
-    Window          aExampleWIN;
-    Window          aExampleDummyWIN;
-    CheckBox        aShowExampleCB;
-    OKButton        aInsertBtn;
-    CancelButton    aCloseBtn;
-    HelpButton      aHelpBtn;
-    MenuButton      aEditBtn;
-    PushButton      aBibBtn;
-    PushButton      aPathBtn;
+    CheckBox*       m_pInsertTipCB;
+    Edit*           m_pNameED;
+    FixedText*      m_pShortNameLbl;
+    NoSpaceEdit*    m_pShortNameEdit;
+    SwGlTreeListBox* m_pCategoryBox;
+    CheckBox*       m_pFileRelCB;
+    CheckBox*       m_pNetRelCB;
+    Window*         m_pExampleWIN;
+    Window*         m_pExampleDummyWIN;
+    CheckBox*       m_pShowExampleCB;
+    PushButton*     m_pInsertBtn;
+    CloseButton*    m_pCloseBtn;
+    MenuButton*     m_pEditBtn;
+    PushButton*     m_pBibBtn;
+    PushButton*     m_pPathBtn;
 
     String          sReadonlyPath;
 
     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >        _xAutoText;
     SwOneExampleFrame*  pExampleFrame;
 
-    PopupMenu*      pMenu;
     SwGlossaryHdl*  pGlossaryHdl;
 
     String          sResumeGroup;
@@ -131,6 +129,7 @@ class SwGlossaryDlg : public SvxStandardDialog
     DECL_LINK( EnableHdl, Menu * );
     DECL_LINK(BibHdl, void *);
     DECL_LINK(EditHdl, void *);
+    DECL_LINK(InsertHdl, void *);
     DECL_LINK( PathHdl, Button * );
     DECL_LINK( CheckBoxHdl, CheckBox * );
     DECL_LINK( ShowPreviewHdl, CheckBox * );
@@ -151,24 +150,20 @@ class SwGlossaryDlg : public SvxStandardDialog
 public:
     SwGlossaryDlg(SfxViewFrame* pViewFrame, SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell);
     ~SwGlossaryDlg();
-    String          GetCurrGrpName() const;
-    inline String   GetCurrLongName() const;
-    inline String   GetCurrShortName() const;
+    String GetCurrGrpName() const;
+    String GetCurrLongName() const
+    {
+        return m_pNameED->GetText();
+    }
+    String GetCurrShortName() const
+    {
+        return m_pShortNameEdit->GetText();
+    }
     static String   GetCurrGroup();
     static void     SetActGroup(const String& rNewGroup);
     static String   GetExtension();
 };
 
-inline String SwGlossaryDlg::GetCurrLongName() const
-{
-    return aNameED.GetText();
-}
-inline String SwGlossaryDlg::GetCurrShortName() const
-{
-    return aShortNameEdit.GetText();
-}
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/misc.hrc b/sw/source/ui/inc/misc.hrc
index da0e00e..dad483d 100644
--- a/sw/source/ui/inc/misc.hrc
+++ b/sw/source/ui/inc/misc.hrc
@@ -23,8 +23,6 @@
 
 #define STR_GLOSSARY_BIB_DLG        (RC_MISC_BEGIN + 5)
 
-#define DLG_GLOSSARY                (RC_MISC_BEGIN + 11)
-
 #define DLG_DOC_FOOTNOTE            (RC_MISC_BEGIN + 13)
 #define DLG_BIB_BASE                (RC_MISC_BEGIN + 16)
 #define DLG_INSERT_BOOKMARK         (RC_MISC_BEGIN + 17)
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 7244ead..140fea7 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -69,10 +69,6 @@
 
 #include "access.hrc"
 
-#define LONG_LENGTH 60
-#define SHORT_LENGTH 30
-
-
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::uno;
@@ -166,8 +162,6 @@ SwNewGlosNameDlg::SwNewGlosNameDlg(Window* pParent,
     FreeResource();
     aOldName.SetText( rOldName );
     aOldShort.SetText( rOldShort );
-    aNewShort.SetMaxTextLen(SHORT_LENGTH);
-    aNewName.SetMaxTextLen(LONG_LENGTH);
     aNewName.SetModifyHdl(LINK(this, SwNewGlosNameDlg, Modify ));
     aNewShort.SetModifyHdl(LINK(this, SwNewGlosNameDlg, Modify ));
     aOk.SetClickHdl(LINK(this, SwNewGlosNameDlg, Rename ));
@@ -192,85 +186,74 @@ void SwGlossaryDlg::SetActGroup(const String &rGrp)
 }
 
 SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
-                            SwGlossaryHdl * pGlosHdl, SwWrtShell *pWrtShell) :
-
-    SvxStandardDialog(&pViewFrame->GetWindow(), SW_RES(DLG_GLOSSARY)),
-
-    aInsertTipCB  (this, SW_RES(CB_INSERT_TIP)),
-    aNameLbl      (this, SW_RES(FT_NAME)),
-    aNameED       (this, SW_RES(ED_NAME)),
-    aShortNameLbl (this, SW_RES(FT_SHORTNAME)),
-    aShortNameEdit(this, SW_RES(ED_SHORTNAME)),
-    aCategoryBox  (this, SW_RES(LB_BIB)),
-    aRelativeFL   (this, SW_RES(FL_RELATIVE)),
-    aFileRelCB    (this, SW_RES(CB_FILE_REL)),
-    aNetRelCB     (this, SW_RES(CB_NET_REL)),
-    aExampleWIN   (this, SW_RES(WIN_EXAMPLE )),
-    aExampleDummyWIN(this, SW_RES(WIN_EXAMPLE_DUMMY )),
-    aShowExampleCB(this, SW_RES(CB_SHOW_EXAMPLE )),
-    aInsertBtn    (this, SW_RES(PB_INSERT)),
-    aCloseBtn     (this, SW_RES(PB_CLOSE)),
-    aHelpBtn      (this, SW_RES(PB_HELP)),
-    aEditBtn      (this, SW_RES(PB_EDIT)),
-    aBibBtn       (this, SW_RES(PB_BIB)),
-    aPathBtn      (this, SW_RES(PB_PATH)),
-
-    sReadonlyPath (SW_RES(ST_READONLY_PATH)),
-    pExampleFrame(0),
-
-    pMenu         (new PopupMenu(SW_RES(MNU_EDIT))),
-    pGlossaryHdl  (pGlosHdl),
-
-    bResume(sal_False),
-
-    bSelection( pWrtShell->IsSelection() ),
-    bReadOnly( sal_False ),
-    bIsOld( sal_False ),
-    bIsDocReadOnly(sal_False),
-
-    pSh           (pWrtShell)
+                            SwGlossaryHdl * pGlosHdl, SwWrtShell *pWrtShell)
+    : SvxStandardDialog(&pViewFrame->GetWindow(), "AutoTextDialog",
+        "modules/swriter/ui/autotext.ui")
+    , sReadonlyPath(SW_RESSTR(STR_READONLY_PATH))
+    , pExampleFrame(0)
+    , pGlossaryHdl(pGlosHdl)
+    , bResume(false)
+    , bSelection(pWrtShell->IsSelection())
+    , bReadOnly(false)
+    , bIsOld(false)
+    , bIsDocReadOnly(false)
+    , pSh(pWrtShell)
 {
+    get(m_pInsertTipCB, "inserttip");
+    get(m_pNameED, "name");
+    get(m_pShortNameLbl, "shortnameft");
+    get(m_pShortNameEdit, "shortname");
+    get(m_pCategoryBox, "category");
+    get(m_pFileRelCB, "relfile");
+    get(m_pNetRelCB, "relnet");
+    get(m_pShowExampleCB, "showpreview");
+    get(m_pInsertBtn, "insert");
+    get(m_pBibBtn, "categories");
+    get(m_pPathBtn, "path");
+    get(m_pExampleWIN, "example");
+    get(m_pExampleDummyWIN, "dummy");
+    get(m_pEditBtn, "autotext");
+
     SvtLinguConfig aLocalLinguConfig;
 
     // initialise static-pointer
     if( !::GetCurrGlosGroup() )
-        ::SetCurrGlosGroup(new String);//(SwGlossaries::GetDefName());
+        ::SetCurrGlosGroup(new String);
 
+    PopupMenu *pMenu = m_pEditBtn->GetPopupMenu();
+    assert(pMenu);
     pMenu->SetActivateHdl(LINK(this,SwGlossaryDlg,EnableHdl));
     pMenu->SetSelectHdl(LINK(this,SwGlossaryDlg,MenuHdl));
-    aEditBtn.SetPopupMenu(pMenu);
-    aEditBtn.SetSelectHdl(LINK(this,SwGlossaryDlg,EditHdl));
-    aPathBtn.SetClickHdl(LINK(this, SwGlossaryDlg, PathHdl));
+    m_pEditBtn->SetSelectHdl(LINK(this,SwGlossaryDlg,EditHdl));
+    m_pPathBtn->SetClickHdl(LINK(this, SwGlossaryDlg, PathHdl));
 
-    aNameED.SetModifyHdl(LINK(this,SwGlossaryDlg,NameModify));
-    aShortNameEdit.SetModifyHdl(LINK(this,SwGlossaryDlg,NameModify));
+    m_pNameED->SetModifyHdl(LINK(this,SwGlossaryDlg,NameModify));
+    m_pShortNameEdit->SetModifyHdl(LINK(this,SwGlossaryDlg,NameModify));
 
-    aCategoryBox.SetDoubleClickHdl(LINK(this,SwGlossaryDlg, NameDoubleClick));
-    aCategoryBox.SetSelectHdl(LINK(this,SwGlossaryDlg,GrpSelect));
-    aBibBtn.SetClickHdl(LINK(this,SwGlossaryDlg,BibHdl));
-    aShowExampleCB.SetClickHdl(LINK(this, SwGlossaryDlg, ShowPreviewHdl));
+    m_pCategoryBox->SetDoubleClickHdl(LINK(this,SwGlossaryDlg, NameDoubleClick));
+    m_pCategoryBox->SetSelectHdl(LINK(this,SwGlossaryDlg,GrpSelect));
+    m_pBibBtn->SetClickHdl(LINK(this,SwGlossaryDlg,BibHdl));
+    m_pShowExampleCB->SetClickHdl(LINK(this, SwGlossaryDlg, ShowPreviewHdl));
 
-    aShortNameEdit.SetMaxTextLen(SHORT_LENGTH);
-    aNameED.SetMaxTextLen(LONG_LENGTH);
-    FreeResource();
+    m_pInsertBtn->SetClickHdl(LINK(this,SwGlossaryDlg,InsertHdl));
 
     const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
 
-    aShowExampleCB.Check( rCfg.IsAutoTextPreview());
-    ShowPreviewHdl(&aShowExampleCB);
+    m_pShowExampleCB->Check( rCfg.IsAutoTextPreview());
+    ShowPreviewHdl(m_pShowExampleCB);
 
     bIsDocReadOnly = pSh->GetView().GetDocShell()->IsReadOnly() ||
                       pSh->HasReadonlySel();
     if( bIsDocReadOnly )
-        aInsertBtn.Enable(sal_False);
-    aNameED.GrabFocus();
-    aCategoryBox.SetHelpId(HID_MD_GLOS_CATEGORY);
-    aCategoryBox.SetStyle(aCategoryBox.GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL|WB_VSCROLL|WB_CLIPCHILDREN|WB_SORT);
-    aCategoryBox.GetModel()->SetSortMode(SortAscending);
-    aCategoryBox.SetHighlightRange();   // select over full width
-    aCategoryBox.SetNodeDefaultImages( );
-    aCategoryBox.SetAccessibleName(SW_RES(STR_ACCESS_SW_CATEGORY));
-    aCategoryBox.SetAccessibleRelationLabeledBy(&aInsertTipCB);
+        m_pInsertBtn->Enable(sal_False);
+    m_pNameED->GrabFocus();
+    m_pCategoryBox->SetHelpId(HID_MD_GLOS_CATEGORY);
+    m_pCategoryBox->SetStyle(m_pCategoryBox->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL|WB_VSCROLL|WB_CLIPCHILDREN|WB_SORT);
+    m_pCategoryBox->GetModel()->SetSortMode(SortAscending);
+    m_pCategoryBox->SetHighlightRange();   // select over full width
+    m_pCategoryBox->SetNodeDefaultImages( );
+    m_pCategoryBox->SetAccessibleName(SW_RES(STR_ACCESS_SW_CATEGORY));
+    m_pCategoryBox->SetAccessibleRelationLabeledBy(m_pInsertTipCB);
 
     Init();
 }
@@ -278,11 +261,9 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
 SwGlossaryDlg::~SwGlossaryDlg()
 {
     SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
-    rCfg.SetAutoTextPreview(aShowExampleCB.IsChecked()) ;
+    rCfg.SetAutoTextPreview(m_pShowExampleCB->IsChecked()) ;
 
-    aCategoryBox.Clear();
-    aEditBtn.SetPopupMenu(0);
-    delete pMenu;
+    m_pCategoryBox->Clear();
     delete pExampleFrame;
 }
 
@@ -304,21 +285,21 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
     // set current text block
     bReadOnly = pGlossaryHdl->IsReadOnly();
     EnableShortName( !bReadOnly );
-    aEditBtn.Enable(!bReadOnly);
+    m_pEditBtn->Enable(!bReadOnly);
     bIsOld = pGlossaryHdl->IsOld();
     if( pParent != pEntry)
     {
-        String aName(pBox->GetEntryText(pEntry));
-        aNameED.SetText(aName);
-        aShortNameEdit.SetText(*(String*)pEntry->GetUserData());
+        OUString aName(pBox->GetEntryText(pEntry));
+        m_pNameED->SetText(aName);
+        m_pShortNameEdit->SetText(*(String*)pEntry->GetUserData());
         pEntry = pBox->GetParent(pEntry);
-        aInsertBtn.Enable( !bIsDocReadOnly);
-        ShowAutoText(*::GetCurrGlosGroup(), aShortNameEdit.GetText());
+        m_pInsertBtn->Enable( !bIsDocReadOnly);
+        ShowAutoText(*::GetCurrGlosGroup(), m_pShortNameEdit->GetText());
     }
     else
         ShowAutoText(aEmptyStr, aEmptyStr);
     // update controls
-    NameModify(&aShortNameEdit);
+    NameModify(m_pShortNameEdit);
     if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
     {
         SfxRequest aReq( pSh->GetView().GetViewFrame(), FN_SET_ACT_GLOSSARY );
@@ -334,7 +315,7 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
 
 void SwGlossaryDlg::Apply()
 {
-    const String aGlosName(aShortNameEdit.GetText());
+    const String aGlosName(m_pShortNameEdit->GetText());
     if(aGlosName.Len()) pGlossaryHdl->InsertGlossary(aGlosName);
     if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
     {
@@ -349,10 +330,10 @@ void SwGlossaryDlg::Apply()
     }
 }
 
-/* inline */ void SwGlossaryDlg::EnableShortName(sal_Bool bOn)
+void SwGlossaryDlg::EnableShortName(sal_Bool bOn)
 {
-    aShortNameLbl.Enable(bOn);
-    aShortNameEdit.Enable(bOn);
+    m_pShortNameLbl->Enable(bOn);
+    m_pShortNameEdit->Enable(bOn);
 }
 
 /* --------------------------------------------------
@@ -362,16 +343,16 @@ SvTreeListEntry* SwGlossaryDlg::DoesBlockExist(const String& rBlock,
                 const String& rShort)
 {
     // look for possible entry in TreeListBox
-    SvTreeListEntry* pEntry = aCategoryBox.FirstSelected();
+    SvTreeListEntry* pEntry = m_pCategoryBox->FirstSelected();
     if(pEntry)
     {
-        if(aCategoryBox.GetParent(pEntry))
-            pEntry = aCategoryBox.GetParent(pEntry);
-        sal_uInt32 nChildCount = aCategoryBox.GetChildCount( pEntry );
+        if(m_pCategoryBox->GetParent(pEntry))
+            pEntry = m_pCategoryBox->GetParent(pEntry);
+        sal_uInt32 nChildCount = m_pCategoryBox->GetChildCount( pEntry );
         for(sal_uInt32 i = 0; i < nChildCount; i++)
         {
-            SvTreeListEntry* pChild = aCategoryBox.GetEntry( pEntry, i );
-            if(rBlock == aCategoryBox.GetEntryText(pChild) &&
+            SvTreeListEntry* pChild = m_pCategoryBox->GetEntry( pEntry, i );
+            if(rBlock == m_pCategoryBox->GetEntryText(pChild) &&
                 (!rShort.Len() || rShort == *(String*)pChild->GetUserData()))
             {
                 return pChild;
@@ -383,13 +364,13 @@ SvTreeListEntry* SwGlossaryDlg::DoesBlockExist(const String& rBlock,
 
 IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit )
 {
-    String aName(aNameED.GetText());
-    sal_Bool bNameED = pEdit == &aNameED;
+    String aName(m_pNameED->GetText());
+    sal_Bool bNameED = pEdit == m_pNameED;
     if( !aName.Len() )
     {
         if(bNameED)
-            aShortNameEdit.SetText(aName);
-        aInsertBtn.Enable(sal_False);
+            m_pShortNameEdit->SetText(aName);
+        m_pInsertBtn->Enable(sal_False);
         return 0;
     }
     String sShortSearch;
@@ -401,15 +382,15 @@ IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit )
             // did the text get in to the Listbbox in the Edit with a click?
         if(bNotFound)
         {
-            aShortNameEdit.SetText( lcl_GetValidShortCut( aName ) );
+            m_pShortNameEdit->SetText( lcl_GetValidShortCut( aName ) );
             EnableShortName();
         }
         else
         {
-            aShortNameEdit.SetText(pGlossaryHdl->GetGlossaryShortName(aName));
+            m_pShortNameEdit->SetText(pGlossaryHdl->GetGlossaryShortName(aName));
             EnableShortName(!bReadOnly);
         }
-        aInsertBtn.Enable(!bNotFound && !bIsDocReadOnly);
+        m_pInsertBtn->Enable(!bNotFound && !bIsDocReadOnly);
     }
     else
     {
@@ -418,7 +399,7 @@ IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit )
         {
             sal_Bool bEnable = !bNotFound;
             bEnable &= !bIsDocReadOnly;
-            aInsertBtn.Enable(bEnable);
+            m_pInsertBtn->Enable(bEnable);
         }
     }
     return 0;
@@ -435,204 +416,197 @@ IMPL_LINK_INLINE_END( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, pBox )
 
 IMPL_LINK( SwGlossaryDlg, EnableHdl, Menu *, pMn )
 {
-    SvTreeListEntry* pEntry = aCategoryBox.FirstSelected();
-
-    const String aEditText(aNameED.GetText());
-    const sal_Bool bHasEntry = aEditText.Len() && aShortNameEdit.GetText().Len();
-    const sal_Bool bExists = 0 != DoesBlockExist(aEditText, aShortNameEdit.GetText());
-    const sal_Bool bIsGroup = pEntry && !aCategoryBox.GetParent(pEntry);
-    pMn->EnableItem(FN_GL_DEFINE, bSelection && bHasEntry && !bExists);
-    pMn->EnableItem(FN_GL_DEFINE_TEXT, bSelection && bHasEntry && !bExists);
-    pMn->EnableItem(FN_GL_COPY_TO_CLIPBOARD, bExists && !bIsGroup);
-    pMn->EnableItem(FN_GL_REPLACE, bSelection && bExists && !bIsGroup && !bIsOld );
-    pMn->EnableItem(FN_GL_REPLACE_TEXT, bSelection && bExists && !bIsGroup && !bIsOld );
-    pMn->EnableItem(FN_GL_EDIT, bExists && !bIsGroup );
-    pMn->EnableItem(FN_GL_RENAME, bExists && !bIsGroup );
-    pMn->EnableItem(FN_GL_DELETE, bExists && !bIsGroup );
-    pMn->EnableItem(FN_GL_MACRO, bExists && !bIsGroup && !bIsOld &&
+    SvTreeListEntry* pEntry = m_pCategoryBox->FirstSelected();
+
+    const String aEditText(m_pNameED->GetText());
+    const sal_Bool bHasEntry = aEditText.Len() && m_pShortNameEdit->GetText().Len();
+    const sal_Bool bExists = 0 != DoesBlockExist(aEditText, m_pShortNameEdit->GetText());
+    const sal_Bool bIsGroup = pEntry && !m_pCategoryBox->GetParent(pEntry);
+    pMn->EnableItem("new", bSelection && bHasEntry && !bExists);
+    pMn->EnableItem("newtext", bSelection && bHasEntry && !bExists);
+    pMn->EnableItem("copy", bExists && !bIsGroup);
+    pMn->EnableItem("replace", bSelection && bExists && !bIsGroup && !bIsOld );
+    pMn->EnableItem("replacetext", bSelection && bExists && !bIsGroup && !bIsOld );
+    pMn->EnableItem("edit", bExists && !bIsGroup );
+    pMn->EnableItem("rename", bExists && !bIsGroup );
+    pMn->EnableItem("delete", bExists && !bIsGroup );
+    pMn->EnableItem("macro", bExists && !bIsGroup && !bIsOld &&
                                     !pGlossaryHdl->IsReadOnly() );
-    pMn->EnableItem( FN_GL_IMPORT, bIsGroup && !bIsOld && !pGlossaryHdl->IsReadOnly() );
+    pMn->EnableItem("import", bIsGroup && !bIsOld && !pGlossaryHdl->IsReadOnly() );
     return 1;
 }
 
 IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
 {
-    sal_Bool bNoAttr = sal_False;
+    OString sItemIdent(pMn->GetCurItemIdent());
 
-    switch(pMn->GetCurItemId())
+    if (sItemIdent == "replace")
     {
-        case FN_GL_REPLACE:
-        case FN_GL_REPLACE_TEXT:
-            pGlossaryHdl->NewGlossary(  aNameED.GetText(),
-                                        aShortNameEdit.GetText(),
-                                        sal_False,
-                                        pMn->GetCurItemId() == FN_GL_REPLACE_TEXT);
-        break;
-        case FN_GL_DEFINE_TEXT:
-            bNoAttr = sal_True;
-            // no break!!!
-        case FN_GL_DEFINE:
+        pGlossaryHdl->NewGlossary(m_pNameED->GetText(),
+                                  m_pShortNameEdit->GetText(),
+                                  false, false);
+    }
+    else if (sItemIdent == "replacetext")
+    {
+        pGlossaryHdl->NewGlossary(m_pNameED->GetText(),
+                                  m_pShortNameEdit->GetText(),
+                                  false, true);
+    }
+    else if (sItemIdent == "new" || sItemIdent == "newtext")
+    {
+        bool bNoAttr = sItemIdent == "newtext";
+
+        const String aStr(m_pNameED->GetText());
+        const String aShortName(m_pShortNameEdit->GetText());
+        if(pGlossaryHdl->HasShortName(aShortName))
         {
-            const String aStr(aNameED.GetText());
-            const String aShortName(aShortNameEdit.GetText());
-            if(pGlossaryHdl->HasShortName(aShortName))
-            {
-                InfoBox(this, SW_RES(MSG_DOUBLE_SHORTNAME)).Execute();
-                aShortNameEdit.SetSelection(Selection(0, SELECTION_MAX));
-                aShortNameEdit.GrabFocus();
-                break;
-            }
-            if(pGlossaryHdl->NewGlossary(aStr, aShortName, sal_False, bNoAttr ))
-            {
-                SvTreeListEntry* pEntry = aCategoryBox.FirstSelected();
-                if(aCategoryBox.GetParent(pEntry))
-                    pEntry = aCategoryBox.GetParent(pEntry);
+            InfoBox(this, SW_RES(MSG_DOUBLE_SHORTNAME)).Execute();
+            m_pShortNameEdit->SetSelection(Selection(0, SELECTION_MAX));
+            m_pShortNameEdit->GrabFocus();
+            return 1;
+        }
+        if(pGlossaryHdl->NewGlossary(aStr, aShortName, sal_False, bNoAttr ))
+        {
+            SvTreeListEntry* pEntry = m_pCategoryBox->FirstSelected();
+            if(m_pCategoryBox->GetParent(pEntry))
+                pEntry = m_pCategoryBox->GetParent(pEntry);
 
-                SvTreeListEntry* pChild = aCategoryBox.InsertEntry(aStr, pEntry);
-                pChild->SetUserData(new String(aShortName));
-                aNameED.SetText(aStr);
-                aShortNameEdit.SetText(aShortName);
-                NameModify(&aNameED);       // for toggling the buttons
+            SvTreeListEntry* pChild = m_pCategoryBox->InsertEntry(aStr, pEntry);
+            pChild->SetUserData(new String(aShortName));
+            m_pNameED->SetText(aStr);
+            m_pShortNameEdit->SetText(aShortName);
+            NameModify(m_pNameED);       // for toggling the buttons
 
-                if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
-                {
-                    SfxRequest aReq(pSh->GetView().GetViewFrame(), FN_NEW_GLOSSARY);
-                    String sTemp(*::GetCurrGlosGroup());
-                    // the zeroth path is not being recorded!
-                    if('0' == sTemp.GetToken(1, GLOS_DELIM).GetChar(0))
-                        sTemp = sTemp.GetToken(0, GLOS_DELIM);
-                    aReq.AppendItem(SfxStringItem(FN_NEW_GLOSSARY, sTemp));
-                    aReq.AppendItem(SfxStringItem(FN_PARAM_1, aShortName));
-                    aReq.AppendItem(SfxStringItem(FN_PARAM_2, aStr));
-                    aReq.Done();
-                }
+            if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
+            {
+                SfxRequest aReq(pSh->GetView().GetViewFrame(), FN_NEW_GLOSSARY);
+                String sTemp(*::GetCurrGlosGroup());
+                // the zeroth path is not being recorded!
+                if('0' == sTemp.GetToken(1, GLOS_DELIM).GetChar(0))
+                    sTemp = sTemp.GetToken(0, GLOS_DELIM);
+                aReq.AppendItem(SfxStringItem(FN_NEW_GLOSSARY, sTemp));
+                aReq.AppendItem(SfxStringItem(FN_PARAM_1, aShortName));
+                aReq.AppendItem(SfxStringItem(FN_PARAM_2, aStr));
+                aReq.Done();
             }
         }
-        break;
-        case FN_GL_COPY_TO_CLIPBOARD :
+    }
+    else if (sItemIdent == "copy")
+    {
+        pGlossaryHdl->CopyToClipboard(*pSh, m_pShortNameEdit->GetText());
+    }
+    else if (sItemIdent == "rename")
+    {
+        m_pShortNameEdit->SetText(pGlossaryHdl->GetGlossaryShortName(m_pNameED->GetText()));
+        SwNewGlosNameDlg* pNewNameDlg = new SwNewGlosNameDlg(this, m_pNameED->GetText(),
+                                        m_pShortNameEdit->GetText() );
+        if( RET_OK == pNewNameDlg->Execute() &&
+            pGlossaryHdl->Rename( m_pShortNameEdit->GetText(),
+                                    pNewNameDlg->GetNewShort(),
+                                    pNewNameDlg->GetNewName()))
         {
-            pGlossaryHdl->CopyToClipboard(*pSh, aShortNameEdit.GetText());
+            SvTreeListEntry* pEntry = m_pCategoryBox->FirstSelected();
+            SvTreeListEntry* pNewEntry = m_pCategoryBox->InsertEntry(
+                    pNewNameDlg->GetNewName(), m_pCategoryBox->GetParent(pEntry));
+            pNewEntry->SetUserData(new String(pNewNameDlg->GetNewShort()));
+            delete (String*)pEntry->GetUserData();
+            m_pCategoryBox->GetModel()->Remove(pEntry);
+            m_pCategoryBox->Select(pNewEntry);
+            m_pCategoryBox->MakeVisible(pNewEntry);
         }
-        break;
-        case FN_GL_EDIT:
-        break;
-        case FN_GL_RENAME:
+        GrpSelect(m_pCategoryBox);
+        delete pNewNameDlg;
+    }
+    else if (sItemIdent == "delete")
+    {
+        QueryBox aQuery(this, SW_RES(MSG_QUERY_DELETE));
+        if(RET_YES == aQuery.Execute())
         {
-            aShortNameEdit.SetText(pGlossaryHdl->GetGlossaryShortName(aNameED.GetText()));
-            SwNewGlosNameDlg* pNewNameDlg = new SwNewGlosNameDlg(this, aNameED.GetText(),
-                                            aShortNameEdit.GetText() );
-            if( RET_OK == pNewNameDlg->Execute() &&
-                pGlossaryHdl->Rename( aShortNameEdit.GetText(),
-                                        pNewNameDlg->GetNewShort(),
-                                        pNewNameDlg->GetNewName()))
+            const String aShortName(m_pShortNameEdit->GetText());
+            const String aTitle(m_pNameED->GetText());
+            if(aTitle.Len() && pGlossaryHdl->DelGlossary(aShortName))
             {
-                SvTreeListEntry* pEntry = aCategoryBox.FirstSelected();
-                SvTreeListEntry* pNewEntry = aCategoryBox.InsertEntry(
-                        pNewNameDlg->GetNewName(), aCategoryBox.GetParent(pEntry));
-                pNewEntry->SetUserData(new String(pNewNameDlg->GetNewShort()));
-                delete (String*)pEntry->GetUserData();
-                aCategoryBox.GetModel()->Remove(pEntry);
-                aCategoryBox.Select(pNewEntry);
-                aCategoryBox.MakeVisible(pNewEntry);
+                SvTreeListEntry* pChild = DoesBlockExist(aTitle, aShortName);
+                OSL_ENSURE(pChild, "entry not found!");
+                SvTreeListEntry* pParent = m_pCategoryBox->GetParent(pChild);
+                m_pCategoryBox->Select(pParent);
+
+                m_pCategoryBox->GetModel()->Remove(pChild);
+                m_pNameED->SetText(OUString());
+                NameModify(m_pNameED);
             }
-            GrpSelect( &aCategoryBox );
-            delete pNewNameDlg;
         }
-        break;
-        case FN_GL_DELETE:
+    }
+    else if (sItemIdent == "macro")
+    {
+        SfxItemSet aSet( pSh->GetAttrPool(), RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 );
+
+        SvxMacro aStart(aEmptyStr, aEmptyStr, STARBASIC);
+        SvxMacro aEnd(aEmptyStr, aEmptyStr, STARBASIC);
+        pGlossaryHdl->GetMacros(m_pShortNameEdit->GetText(), aStart, aEnd );
+
+        SvxMacroItem aItem(RES_FRMMACRO);
+        if( aStart.HasMacro() )
+            aItem.SetMacro( SW_EVENT_START_INS_GLOSSARY, aStart );
+        if( aEnd.HasMacro() )
+            aItem.SetMacro( SW_EVENT_END_INS_GLOSSARY, aEnd );
+
+        aSet.Put( aItem );
+        aSet.Put( SwMacroAssignDlg::AddEvents( MACASSGN_AUTOTEXT ) );
+
+        const SfxPoolItem* pItem;
+        SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+        SfxAbstractDialog* pMacroDlg = pFact->CreateSfxDialog( this, aSet,
+            pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(), SID_EVENTCONFIG );
+        if ( pMacroDlg && pMacroDlg->Execute() == RET_OK &&
+            SFX_ITEM_SET == pMacroDlg->GetOutputItemSet()->GetItemState( RES_FRMMACRO, sal_False, &pItem ) )
         {
-            QueryBox aQuery(this, SW_RES(MSG_QUERY_DELETE));
-            if(RET_YES == aQuery.Execute())
-            {
-                const String aShortName(aShortNameEdit.GetText());
-                const String aTitle(aNameED.GetText());
-                if(aTitle.Len() && pGlossaryHdl->DelGlossary(aShortName))
-                {
-                    SvTreeListEntry* pChild = DoesBlockExist(aTitle, aShortName);
-                    OSL_ENSURE(pChild, "entry not found!");
-                    SvTreeListEntry* pParent = aCategoryBox.GetParent(pChild);
-                    aCategoryBox.Select(pParent);
-
-                    aCategoryBox.GetModel()->Remove(pChild);
-                    aNameED.SetText( aEmptyStr );
-                    NameModify(&aNameED);
-                }
-            }
+            const SvxMacroTableDtor& rTbl = ((SvxMacroItem*)pItem)->GetMacroTable();
+            pGlossaryHdl->SetMacros( m_pShortNameEdit->GetText(),
+                                        rTbl.Get( SW_EVENT_START_INS_GLOSSARY ),
+                                        rTbl.Get( SW_EVENT_END_INS_GLOSSARY ) );
         }
-        break;
-        case FN_GL_MACRO:
+
+        delete pMacroDlg;
+    }
+    else if (sItemIdent == "import")
+    {
+        // call the FileOpenDialog do find WinWord - Files with templates
+        FileDialogHelper aDlgHelper( TemplateDescription::FILEOPEN_SIMPLE, 0 );
+        uno::Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker();
+
+        SvtPathOptions aPathOpt;
+        xFP->setDisplayDirectory(aPathOpt.GetWorkPath() );
+
+        uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
+        SfxFilterMatcher aMatcher( rtl::OUString::createFromAscii(SwDocShell::Factory().GetShortName()) );
+        SfxFilterMatcherIter aIter( aMatcher );
+        const SfxFilter* pFilter = aIter.First();
+        while ( pFilter )
         {
-            SfxItemSet aSet( pSh->GetAttrPool(), RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 );
-
-            SvxMacro aStart(aEmptyStr, aEmptyStr, STARBASIC);
-            SvxMacro aEnd(aEmptyStr, aEmptyStr, STARBASIC);
-            pGlossaryHdl->GetMacros(aShortNameEdit.GetText(), aStart, aEnd );
-
-            SvxMacroItem aItem(RES_FRMMACRO);
-            if( aStart.HasMacro() )
-                aItem.SetMacro( SW_EVENT_START_INS_GLOSSARY, aStart );
-            if( aEnd.HasMacro() )
-                aItem.SetMacro( SW_EVENT_END_INS_GLOSSARY, aEnd );
-
-            aSet.Put( aItem );
-            aSet.Put( SwMacroAssignDlg::AddEvents( MACASSGN_AUTOTEXT ) );
-
-            const SfxPoolItem* pItem;
-            SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-            SfxAbstractDialog* pMacroDlg = pFact->CreateSfxDialog( this, aSet,
-                pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(), SID_EVENTCONFIG );
-            if ( pMacroDlg && pMacroDlg->Execute() == RET_OK &&
-                SFX_ITEM_SET == pMacroDlg->GetOutputItemSet()->GetItemState( RES_FRMMACRO, sal_False, &pItem ) )
+            if( pFilter->GetUserData() == FILTER_WW8 )
             {
-                const SvxMacroTableDtor& rTbl = ((SvxMacroItem*)pItem)->GetMacroTable();
-                pGlossaryHdl->SetMacros( aShortNameEdit.GetText(),
-                                            rTbl.Get( SW_EVENT_START_INS_GLOSSARY ),
-                                            rTbl.Get( SW_EVENT_END_INS_GLOSSARY ) );
+                xFltMgr->appendFilter( pFilter->GetUIName(),
+                            pFilter->GetWildcard().getGlob() );
+                xFltMgr->setCurrentFilter( pFilter->GetUIName() ) ;
             }
 
-            delete pMacroDlg;
+            pFilter = aIter.Next();
         }
-        break;
 
-        case FN_GL_IMPORT:
+        if( aDlgHelper.Execute() == ERRCODE_NONE )
         {
-            // call the FileOpenDialog do find WinWord - Files with templates
-            FileDialogHelper aDlgHelper( TemplateDescription::FILEOPEN_SIMPLE, 0 );
-            uno::Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker();
-
-            SvtPathOptions aPathOpt;
-            xFP->setDisplayDirectory(aPathOpt.GetWorkPath() );
-
-            uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
-            SfxFilterMatcher aMatcher( rtl::OUString::createFromAscii(SwDocShell::Factory().GetShortName()) );
-            SfxFilterMatcherIter aIter( aMatcher );
-            const SfxFilter* pFilter = aIter.First();
-            while ( pFilter )
-            {
-                if( pFilter->GetUserData() == FILTER_WW8 )
-                {
-                    xFltMgr->appendFilter( pFilter->GetUIName(),
-                                pFilter->GetWildcard().getGlob() );
-                    xFltMgr->setCurrentFilter( pFilter->GetUIName() ) ;
-                }
-
-                pFilter = aIter.Next();
-            }
-
-            if( aDlgHelper.Execute() == ERRCODE_NONE )
+            if( pGlossaryHdl->ImportGlossaries( xFP->getFiles().getConstArray()[0] ))
+                Init();
+            else
             {
-                if( pGlossaryHdl->ImportGlossaries( xFP->getFiles().getConstArray()[0] ))
-                    Init();
-                else
-                {
-                    InfoBox(this, SW_RES( MSG_NO_GLOSSARIES )).Execute();
-                }
+                InfoBox(this, SW_RES( MSG_NO_GLOSSARIES )).Execute();
             }
         }
-           break;
-
-        default:
-            return 0;
+    }
+    else
+    {
+        return 0;
     }
     return 1;
 }
@@ -683,10 +657,10 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
                 Init();
                 //if new groups were created - select one of them
                 String sNewGroup = pDlg->GetCreatedGroupName();
-                SvTreeListEntry* pEntry = aCategoryBox.First();
+                SvTreeListEntry* pEntry = m_pCategoryBox->First();
                 while(sNewGroup.Len() && pEntry)
                 {
-                    if(!aCategoryBox.GetParent(pEntry))
+                    if(!m_pCategoryBox->GetParent(pEntry))
                     {
                         GroupUserData* pGroupData = (GroupUserData*)pEntry->GetUserData();
                         String sGroup = pGroupData->sGroupName;
@@ -694,13 +668,13 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
                         sGroup += String::CreateFromInt32(pGroupData->nPathIdx);
                         if(sGroup == sNewGroup)
                         {
-                            aCategoryBox.Select(pEntry);
-                            aCategoryBox.MakeVisible(pEntry);
-                            GrpSelect(&aCategoryBox);
+                            m_pCategoryBox->Select(pEntry);
+                            m_pCategoryBox->MakeVisible(pEntry);
+                            GrpSelect(m_pCategoryBox);
                             break;
                         }
                     }
-                    pEntry = aCategoryBox.Next(pEntry);
+                    pEntry = m_pCategoryBox->Next(pEntry);
                 }
 
             }
@@ -710,7 +684,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
         {
             QueryBox aBox(this, WB_YES_NO, sReadonlyPath);
             if(RET_YES == aBox.Execute())
-                PathHdl(&aPathBtn);
+                PathHdl(m_pPathBtn);
         }
     }
     return 0;
@@ -721,8 +695,8 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
 ------------------------------------------------------------------------*/
 void SwGlossaryDlg::Init()
 {
-    aCategoryBox.SetUpdateMode( sal_False );
-    aCategoryBox.Clear();
+    m_pCategoryBox->SetUpdateMode( sal_False );
+    m_pCategoryBox->Clear();
     // display text block regions
     const sal_uInt16 nCnt = pGlossaryHdl->GetGroupCnt();
     SvTreeListEntry* pSelEntry = 0;
@@ -741,7 +715,7 @@ void SwGlossaryDlg::Init()
             sTitle = sGroupName.GetToken( 0, GLOS_DELIM );
         if(sTitle == sMyAutoTextEnglish)
             sTitle = sMyAutoTextTranslated;
-        SvTreeListEntry* pEntry = aCategoryBox.InsertEntry( sTitle );
+        SvTreeListEntry* pEntry = m_pCategoryBox->InsertEntry( sTitle );
         sal_uInt16 nPath = static_cast< sal_uInt16 >(sGroupName.GetToken( 1, GLOS_DELIM ).ToInt32());
 
         GroupUserData* pData = new GroupUserData;
@@ -760,7 +734,7 @@ void SwGlossaryDlg::Init()
             for(sal_uInt16 i = 0; i < nCount; ++i)
             {
                 String sGroupTitle(pGlossaryHdl->GetGlossaryName(i));
-                SvTreeListEntry* pChild = aCategoryBox.InsertEntry(
+                SvTreeListEntry* pChild = m_pCategoryBox->InsertEntry(
                                     sGroupTitle, pEntry);
                 pChild->SetUserData(new String(pGlossaryHdl->GetGlossaryShortName(i)));
             }
@@ -770,10 +744,10 @@ void SwGlossaryDlg::Init()
     if(!pSelEntry)
     {
         //find a non-readonly group
-        SvTreeListEntry* pSearch = aCategoryBox.First();
+        SvTreeListEntry* pSearch = m_pCategoryBox->First();
         while(pSearch)
         {
-            if(!aCategoryBox.GetParent(pSearch))
+            if(!m_pCategoryBox->GetParent(pSearch))
             {
                 GroupUserData* pData = (GroupUserData*)pSearch->GetUserData();
                 if(!pData->bReadonly)
@@ -782,41 +756,41 @@ void SwGlossaryDlg::Init()
                     break;
                 }
             }
-            pSearch = aCategoryBox.Next(pSearch);
+            pSearch = m_pCategoryBox->Next(pSearch);
         }
         if(!pSelEntry)
-            pSelEntry = aCategoryBox.GetEntry(0);
+            pSelEntry = m_pCategoryBox->GetEntry(0);
     }
     if(pSelEntry)
     {
-        aCategoryBox.Expand(pSelEntry);
-        aCategoryBox.Select(pSelEntry);
-        aCategoryBox.MakeVisible(pSelEntry);
-        GrpSelect(&aCategoryBox);
+        m_pCategoryBox->Expand(pSelEntry);
+        m_pCategoryBox->Select(pSelEntry);
+        m_pCategoryBox->MakeVisible(pSelEntry);
+        GrpSelect(m_pCategoryBox);
     }
     //JP 16.11.99: the SvxTreeListBox has a Bug. The Box dont recalc the
     //      outputsize, when all entries are insertet. The result is, that
     //      the Focus/Highlight rectangle is to large and paintet over the
     //      HScrollbar. -> Fix: call the resize
-    aCategoryBox.Resize();
+    m_pCategoryBox->Resize();
 
-    aCategoryBox.GetModel()->Resort();
-    aCategoryBox.SetUpdateMode( sal_True );
-    aCategoryBox.Update();
+    m_pCategoryBox->GetModel()->Resort();
+    m_pCategoryBox->SetUpdateMode( sal_True );
+    m_pCategoryBox->Update();
 
     const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
-    aFileRelCB.Check( rCfg.IsSaveRelFile() );
-    aFileRelCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
-    aNetRelCB.Check( rCfg.IsSaveRelNet() );
-    aNetRelCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
-    aInsertTipCB.Check( rCfg.IsAutoTextTip() );
-    aInsertTipCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
+    m_pFileRelCB->Check( rCfg.IsSaveRelFile() );
+    m_pFileRelCB->SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
+    m_pNetRelCB->Check( rCfg.IsSaveRelNet() );
+    m_pNetRelCB->SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
+    m_pInsertTipCB->Check( rCfg.IsAutoTextTip() );
+    m_pInsertTipCB->SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
 }
 
 IMPL_LINK_NOARG_INLINE_START(SwGlossaryDlg, EditHdl)
 {
 // EndDialog must not be called in MenuHdl
-    if(aEditBtn.GetCurItemId() == FN_GL_EDIT )
+    if (m_pEditBtn->GetCurItemIdent() == "edit")
     {
         SwTextBlocks *pGroup = ::GetGlossaries()->GetGroupDoc (  GetCurrGrpName () );
         sal_Bool bRet = pGlossaryHdl->ConvertToNew ( *pGroup );
@@ -864,10 +838,10 @@ IMPL_LINK_NOARG(SwNewGlosNameDlg, Rename)
 IMPL_LINK( SwGlossaryDlg, CheckBoxHdl, CheckBox *, pBox )
 {
     SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
-    sal_Bool bCheck = pBox->IsChecked();
-    if( pBox == &aInsertTipCB )
+    bool bCheck = pBox->IsChecked();
+    if (pBox == m_pInsertTipCB)
         rCfg.SetAutoTextTip(bCheck);
-    else if(pBox == &aFileRelCB)
+    else if(pBox == m_pFileRelCB)
         rCfg.SetSaveRelFile(bCheck);
     else
         rCfg.SetSaveRelNet(bCheck);
@@ -877,15 +851,35 @@ IMPL_LINK( SwGlossaryDlg, CheckBoxHdl, CheckBox *, pBox )
 /* --------------------------------------------------
  * TreeListBox for groups and blocks
  * --------------------------------------------------*/
-SwGlTreeListBox::SwGlTreeListBox(Window* pParent, const ResId& rResId) :
-    SvTreeListBox(pParent, rResId),
-    sReadonly     (SW_RES(ST_READONLY)),
-    pDragEntry(0)
+SwGlTreeListBox::SwGlTreeListBox(Window* pParent, const ResId& rResId)
+    : SvTreeListBox(pParent, rResId)
+    , sReadonly(SW_RESSTR(SW_STR_READONLY))
+    , pDragEntry(0)
 {
     FreeResource();
     SetDragDropMode( SV_DRAGDROP_CTRL_MOVE|SV_DRAGDROP_CTRL_COPY );
 }
 
+SwGlTreeListBox::SwGlTreeListBox(Window* pParent, WinBits nBits)
+    : SvTreeListBox(pParent, nBits)
+    , sReadonly(SW_RESSTR(SW_STR_READONLY)),
+    pDragEntry(0)
+{
+    SetDragDropMode( SV_DRAGDROP_CTRL_MOVE|SV_DRAGDROP_CTRL_COPY );
+}
+
+Size SwGlTreeListBox::GetOptimalSize(WindowSizeType eType) const
+{
+    if (eType == WINDOWSIZE_PREFERRED)
+        return LogicToPixel(Size(212, 84), MapMode(MAP_APPFONT));
+    return SvTreeListBox::GetOptimalSize(eType);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwGlTreeListBox(Window *pParent, VclBuilder::stringmap &)
+{
+    return new SwGlTreeListBox(pParent, WB_BORDER | WB_TABSTOP);
+}
+
 void SwGlTreeListBox::Clear()
 {
     SvTreeListEntry* pEntry = First();
@@ -1086,12 +1080,12 @@ sal_Bool  SwGlTreeListBox::NotifyCopying(   SvTreeListEntry*  pTarget,
 
 String SwGlossaryDlg::GetCurrGrpName() const
 {
-    SvTreeListEntry* pEntry = aCategoryBox.FirstSelected();
+    SvTreeListEntry* pEntry = m_pCategoryBox->FirstSelected();
     String sRet;
     if(pEntry)
     {
         pEntry =
-            aCategoryBox.GetParent(pEntry) ? aCategoryBox.GetParent(pEntry) : pEntry;
+            m_pCategoryBox->GetParent(pEntry) ? m_pCategoryBox->GetParent(pEntry) : pEntry;
         GroupUserData* pGroupData = (GroupUserData*)pEntry->GetUserData();
         sRet = pGroupData->sGroupName;
         sRet += GLOS_DELIM;
@@ -1125,6 +1119,12 @@ IMPL_LINK( SwGlossaryDlg, PathHdl, Button *, pBtn )
     return 0;
 }
 
+IMPL_LINK_NOARG(SwGlossaryDlg, InsertHdl)
+{
+    EndDialog(true);
+    return 0;
+}
+
 IMPL_LINK( SwGlossaryDlg, ShowPreviewHdl, CheckBox *, pBox )
 {
     sal_Bool bCreated = sal_False;
@@ -1134,33 +1134,33 @@ IMPL_LINK( SwGlossaryDlg, ShowPreviewHdl, CheckBox *, pBox )
         if(!pExampleFrame)
         {
             Link aLink(LINK(this, SwGlossaryDlg, PreviewLoadedHdl));
-            pExampleFrame = new SwOneExampleFrame( aExampleWIN,
+            pExampleFrame = new SwOneExampleFrame( *m_pExampleWIN,
                             EX_SHOW_ONLINE_LAYOUT, &aLink );
             bCreated = sal_True;
         }
     }
 
     sal_Bool bShow = pBox->IsChecked() && !bCreated;
-    aExampleWIN.Show( bShow );
-    aExampleDummyWIN.Show(!bShow);
+    m_pExampleWIN->Show( bShow );
+    m_pExampleDummyWIN->Show(!bShow);
     if( ::GetCurrGlosGroup() )
-        ShowAutoText(*::GetCurrGlosGroup(), aShortNameEdit.GetText());
+        ShowAutoText(*::GetCurrGlosGroup(), m_pShortNameEdit->GetText());
 
     return 0;
 };
 
 IMPL_LINK_NOARG(SwGlossaryDlg, PreviewLoadedHdl)
 {
-    sal_Bool bShow = aShowExampleCB.IsChecked();
-    aExampleWIN.Show( bShow );
-    aExampleDummyWIN.Show(!bShow);
+    sal_Bool bShow = m_pShowExampleCB->IsChecked();
+    m_pExampleWIN->Show( bShow );
+    m_pExampleDummyWIN->Show(!bShow);
     ResumeShowAutoText();
     return 0;
 }
 
 void SwGlossaryDlg::ShowAutoText(const String& rGroup, const String& rShortName)
 {
-    if(aExampleWIN.IsVisible())
+    if(m_pExampleWIN->IsVisible())
     {
         SetResumeData(rGroup, rShortName);
         //try to make an Undo()
@@ -1171,7 +1171,7 @@ void SwGlossaryDlg::ShowAutoText(const String& rGroup, const String& rShortName)
 void    SwGlossaryDlg::ResumeShowAutoText()
 {
     String sGroup, sShortName;
-    if(GetResumeData(sGroup, sShortName) && aExampleWIN.IsVisible())
+    if(GetResumeData(sGroup, sShortName) && m_pExampleWIN->IsVisible())
     {
         if(!_xAutoText.is())
         {
diff --git a/sw/source/ui/misc/glossary.hrc b/sw/source/ui/misc/glossary.hrc
index 9034e23..c053729 100644
--- a/sw/source/ui/misc/glossary.hrc
+++ b/sw/source/ui/misc/glossary.hrc
@@ -16,41 +16,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
-// Box text blocks
-#define FT_SHORTNAME        1
-#define ED_SHORTNAME        2
-#define FT_NAME             3
-#define ED_NAME             4
-#define CB_INSERT_TIP                   5
-
-#define PB_INSERT           50
-#define PB_EDIT             52
-#define PB_BIB              54
-#define PB_CLOSE            55
-#define PB_PATH             56
-#define PB_HELP             57
-
-#define MNU_EDIT            60
-#define FN_GL_DEFINE        61
-#define FN_GL_DEFINE_TEXT   62
-#define FN_GL_REPLACE       63
-#define FN_GL_EDIT          64
-#define FN_GL_DELETE        65
-#define FN_GL_RENAME        66
-#define FN_GL_MACRO         67
-#define CB_FILE_REL         68
-#define CB_NET_REL          69
-#define FL_RELATIVE         70
-#define WIN_EXAMPLE         72
-#define CB_SHOW_EXAMPLE     73
-#define FN_GL_COPY_TO_CLIPBOARD 74
-#define FN_GL_IMPORT        75
-#define ST_READONLY         76
-#define ST_READONLY_PATH    77
-#define FN_GL_REPLACE_TEXT  78
-#define WIN_EXAMPLE_DUMMY   79
-
 // Box library text blocks
 #define FL_EDIT                         1
 
diff --git a/sw/source/ui/misc/glossary.src b/sw/source/ui/misc/glossary.src
index 4842f71..b60c5a1 100644
--- a/sw/source/ui/misc/glossary.src
+++ b/sw/source/ui/misc/glossary.src
@@ -22,235 +22,6 @@
 #include "helpid.h"
 #include "access.hrc"
 
-ModalDialog DLG_GLOSSARY
-{
-    HelpID = CMD_FN_GLOSSARY_DLG ;
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 375 , 164 ) ;
-    Text [ en-US ] = "AutoText" ;
-    Moveable = TRUE ;
-    CheckBox CB_INSERT_TIP
-    {
-        HelpID = "sw:CheckBox:DLG_GLOSSARY:CB_INSERT_TIP";
-        Pos = MAP_APPFONT ( 12 , 12 ) ;
-        Size = MAP_APPFONT ( 200 , 12 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "~Display remainder of name as suggestion while typing" ;
-    };
-    FixedText FT_NAME
-    {
-        Pos = MAP_APPFONT ( 12 , 31 ) ;
-        Size = MAP_APPFONT ( 40 , 8 ) ;
-        Text [ en-US ] = "~Name" ;
-        Left = TRUE ;
-    };
-    Edit ED_NAME
-    {
-        HelpID = "sw:Edit:DLG_GLOSSARY:ED_NAME";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 55 , 29 ) ;
-        Size = MAP_APPFONT ( 85 , 12 ) ;
-        TabStop = TRUE ;
-        Left = TRUE ;
-    };
-    FixedText FT_SHORTNAME
-    {
-        Disable = TRUE ;
-        Pos = MAP_APPFONT ( 143 , 31 ) ;
-        Size = MAP_APPFONT ( 57 , 8 ) ;
-        Text [ en-US ] = "~Shortcut" ;
-        Right = TRUE ;
-    };
-    Edit ED_SHORTNAME
-    {
-        HelpID = "sw:Edit:DLG_GLOSSARY:ED_SHORTNAME";
-        Disable = TRUE ;
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 203 , 29 ) ;
-        Size = MAP_APPFONT ( 21 , 12 ) ;
-        TabStop = TRUE ;
-        Left = TRUE ;
-    };
-    Control LB_BIB
-    {
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 12 , 44 ) ;
-        Size = MAP_APPFONT ( 212 , 84 ) ;
-        TabStop = TRUE ;
-         //        Sort = TRUE ;
-         //        CurPos = 0 ;
-        String ST_READONLY
-        {
-            Text [ en-US ] = "read-only";
-        };
-    };
-    FixedLine FL_RELATIVE
-    {
-        Pos = MAP_APPFONT (    6 , 134 ) ;
-        Size = MAP_APPFONT ( 221 , 8 ) ;
-        Text [ en-US ] = "Save links relative to";
-    };
-    CheckBox CB_FILE_REL
-    {
-        HelpID = "sw:CheckBox:DLG_GLOSSARY:CB_FILE_REL";
-        Pos = MAP_APPFONT ( 14 , 145 ) ;
-        Size = MAP_APPFONT ( 90 , 12 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "~File system" ;
-    };
-    CheckBox CB_NET_REL
-    {
-        HelpID = "sw:CheckBox:DLG_GLOSSARY:CB_NET_REL";
-        Pos = MAP_APPFONT ( 109 , 145 ) ;
-        Size = MAP_APPFONT ( 90 , 12 ) ;
-        Text [ en-US ] = "Inte~rnet" ;
-    };
-    Window WIN_EXAMPLE
-    {
-        Pos = MAP_APPFONT ( 231 , 14 ) ;
-        Size = MAP_APPFONT ( 82 , 124 ) ;
-    };
-    Window WIN_EXAMPLE_DUMMY
-    {
-        Pos = MAP_APPFONT ( 231 , 14 ) ;
-        Size = MAP_APPFONT ( 82 , 124 ) ;
-        Border = TRUE;
-    };
-    CheckBox CB_SHOW_EXAMPLE
-    {
-        HelpID = "sw:CheckBox:DLG_GLOSSARY:CB_SHOW_EXAMPLE";
-        Pos = MAP_APPFONT ( 231 , 145 ) ;
-        Size = MAP_APPFONT ( 82 , 12 ) ;
-        Text [ en-US ] = "Sho~w preview";
-    };
-    OKButton PB_INSERT
-    {
-        Pos = MAP_APPFONT ( 319 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "~Insert" ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton PB_CLOSE
-    {
-        Pos = MAP_APPFONT ( 319 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "~Close" ;
-        TabStop = TRUE ;
-    };
-    HelpButton PB_HELP
-    {
-        Pos = MAP_APPFONT ( 319 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-    };
-    MenuButton PB_EDIT
-    {
-        HelpID = "sw:MenuButton:DLG_GLOSSARY:PB_EDIT";
-        Pos = MAP_APPFONT ( 319 , 60 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "AutoTe~xt" ;
-        TabStop = TRUE ;
-    };
-    PushButton PB_BIB
-    {
-        HelpID = "sw:PushButton:DLG_GLOSSARY:PB_BIB";
-        Pos = MAP_APPFONT ( 319 , 77 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "C~ategories..." ;
-        TabStop = TRUE ;
-    };
-    PushButton PB_PATH
-    {
-        HelpID = "sw:PushButton:DLG_GLOSSARY:PB_PATH";
-        Pos = MAP_APPFONT ( 319 , 94 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "~Path..." ;
-    };
-    String ST_READONLY_PATH
-    {
-        Text [ en-US ] = "The 'AutoText' directories are read-only. Do you want to call the path settings dialog?";
-    };
-    Menu MNU_EDIT
-    {
-        ItemList =
-        {
-            MenuItem
-            {
-                Identifier = FN_GL_DEFINE ;
-                HelpID = HID_MD_GLOS_DEFINE ;
-                Text [ en-US ] = "~New" ;
-            };
-            MenuItem
-            {
-                Identifier = FN_GL_DEFINE_TEXT ;
-                HelpID = HID_MD_GLOS_DEFINE_TEXT ;
-                Text [ en-US ] = "New (text only)" ;
-            };
-            MenuItem
-            {
-                Identifier = FN_GL_COPY_TO_CLIPBOARD;
-                HelpID = HID_MD_COPY_TO_CLIPBOARD;
-                Text [ en-US ] = "~Copy";
-            };
-            MenuItem
-            {
-                Identifier = FN_GL_REPLACE ;
-                HelpID = HID_MD_GLOS_REPLACE ;
-                Text [ en-US ] = "Replace" ;
-            };
-            MenuItem
-            {
-                Identifier = FN_GL_REPLACE_TEXT;
-                HelpID = HID_MD_GLOS_REPLACE;
-                Text [ en-US ] = "Rep~lace (text only)" ;
-            };
-            MenuItem
-            {
-                Identifier = FN_GL_RENAME ;
-                HelpID = HID_MD_GLOS_RENAME ;
-                Text [ en-US ] = "Rename..." ;
-            };
-            MenuItem
-            {
-                Identifier = FN_GL_DELETE ;
-                HelpID = HID_MD_GLOS_DELETE ;
-                Text [ en-US ] = "~Delete" ;
-            };
-            MenuItem
-            {
-                Separator = TRUE ;
-            };
-            MenuItem
-            {
-                Identifier = FN_GL_EDIT ;
-                HelpID = HID_MD_GLOS_EDIT ;
-                Text [ en-US ] = "~Edit" ;
-            };
-            MenuItem
-            {
-                Separator = TRUE ;
-            };
-            MenuItem
-            {
-                Identifier = FN_GL_MACRO ;
-                HelpID = HID_MD_GLOS_MACRO ;
-                Text [ en-US ] = "~Macro..." ;
-            };
-            MenuItem
-            {
-                Separator = TRUE ;
-            };
-            MenuItem
-            {
-                Identifier = FN_GL_IMPORT;
-                HelpID = HID_MD_GLOS_IMPORT ;
-                Text [ en-US ] = "~Import...";
-            };
-        };
-    };
-};
 InfoBox MSG_DOUBLE_SHORTNAME
 {
     Message [ en-US ] = "Shortcut name already exists. Please choose another name." ;
diff --git a/sw/source/ui/uiview/view.hrc b/sw/source/ui/uiview/view.hrc
index 428d51d..8f33c87 100644
--- a/sw/source/ui/uiview/view.hrc
+++ b/sw/source/ui/uiview/view.hrc
@@ -51,7 +51,6 @@
 #define STR_PRINT_MSG               (RC_VIEW_BEGIN + 27)
 #define STR_PRINT_ALL               (RC_VIEW_BEGIN + 28)
 #define STR_PRINT_SELECTION         (RC_VIEW_BEGIN + 29)
-#define STR_READONLY_SEL            (RC_VIEW_BEGIN + 30)
 
 #define RID_PVIEW_TOOLBOX           (RC_VIEW_BEGIN + 31)
 #define STR_WEBOPTIONS              (RC_VIEW_BEGIN + 32)
diff --git a/sw/source/ui/uiview/view.src b/sw/source/ui/uiview/view.src
index 8d6f6b4..e29623e 100644
--- a/sw/source/ui/uiview/view.src
+++ b/sw/source/ui/uiview/view.src
@@ -173,10 +173,6 @@ String STR_PRINT_SELECTION
 {
     Text [ en-US ] = "Selection";
 };
-String STR_READONLY_SEL
-{
-    Text [ en-US ] = "read-only";
-};
 String STR_SAVEAS_SRC
 {
     Text [ en-US ] = "~Export source..." ;
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index b372ccc..1ae6d52 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -1483,7 +1483,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
                 {
                     if( sStr.Len() )
                         sStr.InsertAscii( sStatusDelim, 0 );
-                    sStr.Insert( SW_RESSTR( STR_READONLY_SEL ), 0 );
+                    sStr.Insert( SW_RESSTR(SW_STR_READONLY), 0 );
                 }
                 if( sStr.Len() )
                     rSet.Put( SfxStringItem( SID_TABLE_CELL, sStr ));
diff --git a/sw/uiconfig/swriter/ui/autotext.ui b/sw/uiconfig/swriter/ui/autotext.ui
index ba33858..1535a07 100644
--- a/sw/uiconfig/swriter/ui/autotext.ui
+++ b/sw/uiconfig/swriter/ui/autotext.ui
@@ -1,23 +1,122 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkWindow" id="AutoText">
+  <object class="GtkDialog" id="AutoTextDialog">
     <property name="can_focus">False</property>
-    <child>
-      <object class="GtkBox" id="box1">
-        <property name="visible">True</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">AutoText</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
-        <property name="margin_left">2</property>
-        <property name="margin_right">2</property>
-        <property name="margin_top">5</property>
-        <property name="margin_bottom">3</property>
-        <property name="spacing">4</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <property name="layout_style">start</property>
+            <child>
+              <object class="GtkButton" id="insert">
+                <property name="label" translatable="yes">_Insert</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="close">
+                <property name="label">gtk-close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="autotext:editmenu">
+                <property name="label" translatable="yes">AutoTe_xt</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="categories">
+                <property name="label" translatable="yes">Cat_egories...</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="path">
+                <property name="label" translatable="yes">_Path...</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">5</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
         <child>
           <object class="GtkGrid" id="grid1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="row_spacing">20</property>
-            <property name="column_spacing">10</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">18</property>
             <child>
               <object class="GtkFrame" id="frame1">
                 <property name="visible">True</property>
@@ -28,19 +127,20 @@
                   <object class="GtkAlignment" id="alignment1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="top_padding">6</property>
                     <property name="left_padding">12</property>
                     <child>
                       <object class="GtkGrid" id="grid4">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="column_homogeneous">True</property>
                         <child>
-                          <object class="GtkCheckButton" id="checkbutton3">
-                            <property name="label" translatable="yes">File System </property>
-                            <property name="use_action_appearance">False</property>
+                          <object class="GtkCheckButton" id="relfile">
+                            <property name="label" translatable="yes">_File System</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
+                            <property name="use_underline">True</property>
                             <property name="xalign">0</property>
                             <property name="draw_indicator">True</property>
                           </object>
@@ -52,13 +152,12 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkCheckButton" id="checkbutton4">
-                            <property name="label" translatable="yes">Internet </property>
-                            <property name="use_action_appearance">False</property>
+                          <object class="GtkCheckButton" id="relnet">
+                            <property name="label" translatable="yes">Inter_net</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
+                            <property name="use_underline">True</property>
                             <property name="xalign">0</property>
                             <property name="draw_indicator">True</property>
                           </object>
@@ -92,13 +191,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkCheckButton" id="checkbutton1">
-                <property name="label" translatable="yes">Show preview</property>
-                <property name="use_action_appearance">False</property>
+              <object class="GtkCheckButton" id="showpreview">
+                <property name="label" translatable="yes">Sho_w preview</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
-                <property name="use_action_appearance">False</property>
+                <property name="valign">end</property>
+                <property name="use_underline">True</property>
                 <property name="xalign">0</property>
                 <property name="draw_indicator">True</property>
               </object>
@@ -110,66 +209,27 @@
               </packing>
             </child>
             <child>
-              <object class="GtkDrawingArea" id="drawingarea1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">0</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkGrid" id="grid2">
+              <object class="GtkAlignment" id="alignment2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="row_spacing">25</property>
-                <property name="column_spacing">15</property>
-                <child>
-                  <object class="GtkCheckButton" id="checkbutton2">
-                    <property name="label" translatable="yes">Display remainder of name as suggestion while typing </property>
-                    <property name="use_action_appearance">False</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_action_appearance">False</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">0</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkScrolledWindow" id="scrolledwindow1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="shadow_type">in</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">2</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
+                <property name="margin_left">12</property>
                 <child>
-                  <object class="GtkGrid" id="grid3">
+                  <object class="GtkGrid" id="grid2">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="row_spacing">12</property>
+                    <property name="column_spacing">12</property>
                     <child>
-                      <object class="GtkLabel" id="label2">
+                      <object class="GtkCheckButton" id="inserttip">
+                        <property name="label" translatable="yes">_Display remainder of name as suggestion while typing</property>
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Name </property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -179,51 +239,90 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkLabel" id="label3">
+                      <object class="GtkGrid" id="grid3">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Shortcut</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkEntry" id="entry1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="invisible_char">•</property>
+                        <property name="column_spacing">12</property>
+                        <child>
+                          <object class="GtkLabel" id="nameft">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Name</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="shortnameft">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Shortcut</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkEntry" id="name">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="hexpand">True</property>
+                            <property name="max_length">60</property>
+                            <property name="invisible_char">•</property>
+                            <property name="invisible_char_set">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="swuilo:NoSpaceEdit" id="shortname">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="halign">end</property>
+                            <property name="max_length">30</property>
+                            <property name="width_chars">6</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">3</property>
+                            <property name="top_attach">0</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list