[Libreoffice-commits] .: 6 commits - cui/AllLangResTarget_cui.mk cui/source cui/uiconfig cui/UI_cui.mk sc/sdi sd/sdi sfx2/AllLangResTarget_sfx2.mk sfx2/inc sfx2/Module_sfx2.mk sfx2/source sfx2/uiconfig sfx2/UI_sfx.mk sw/sdi vcl/inc vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Oct 5 06:38:38 PDT 2012
cui/AllLangResTarget_cui.mk | 1
cui/UI_cui.mk | 1
cui/source/dialogs/hyphen.cxx | 289 +++++++++++-------------------------
cui/source/dialogs/hyphen.hrc | 37 ----
cui/source/dialogs/hyphen.src | 119 ---------------
cui/source/inc/cuires.hrc | 2
cui/source/inc/helpid.hrc | 1
cui/source/inc/hyphen.hxx | 58 ++++++-
cui/uiconfig/ui/hyphenate.ui | 210 ++++++++++++++++++++++++++
sc/sdi/scalc.sdi | 2
sd/sdi/sdraw.sdi | 2
sfx2/AllLangResTarget_sfx2.mk | 1
sfx2/Module_sfx2.mk | 1
sfx2/UI_sfx.mk | 16 ++
sfx2/inc/sfx2/passwd.hxx | 91 +++++++----
sfx2/inc/sfx2/sfx.hrc | 6
sfx2/source/appl/sfx.src | 14 +
sfx2/source/dialog/dialog.hrc | 1
sfx2/source/dialog/passwd.cxx | 261 ++++++++-------------------------
sfx2/source/dialog/passwd.hrc | 47 ------
sfx2/source/dialog/passwd.src | 144 ------------------
sfx2/source/inc/helpid.hrc | 1
sfx2/uiconfig/ui/password.ui | 329 ++++++++++++++++++++++++++++++++++++++++++
sw/sdi/swriter.sdi | 2
vcl/inc/svids.hrc | 1
vcl/inc/vcl/builder.hxx | 12 +
vcl/source/src/btntext.src | 5
vcl/source/window/builder.cxx | 173 +++++++++++-----------
28 files changed, 948 insertions(+), 879 deletions(-)
New commits:
commit 8f6d8d471d62f412956cb3dad339e5ab9a99dd5f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 5 14:08:28 2012 +0100
sort by grid position, then pack type, then pack position
so that focus ends up on the visually first enabled control
Change-Id: Ia279c4531536305ce43eb8372abde2445769487d
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index 1910791..246f68d 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -121,6 +121,18 @@ private:
Window *get_by_name(OString sID);
void delete_by_name(OString sID);
+
+ class sortIntoBestTabTraversalOrder
+ : public std::binary_function<const Window*, const Window*, bool>
+ {
+ VclBuilder *m_pBuilder;
+ public:
+ sortIntoBestTabTraversalOrder(VclBuilder *pBuilder)
+ : m_pBuilder(pBuilder)
+ {
+ }
+ bool operator()(const Window *pA, const Window *pB) const;
+ };
public:
VclBuilder(Window *pParent, OUString sUIRootDir, OUString sUIFile, OString sID = OString());
~VclBuilder();
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index e421320..1fdad86 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -869,20 +869,32 @@ void VclBuilder::handleTabChild(Window *pParent, xmlreader::XmlReader &reader)
pTabControl->RemovePage(pTabControl->GetCurPageId());
}
-namespace
+//so that tabbing between controls goes in a visually sensible sequence
+//we sort these into a best-tab-order sequence
+bool VclBuilder::sortIntoBestTabTraversalOrder::operator()(const Window *pA, const Window *pB) const
{
- bool sortByGridPositions(Window *pA, Window *pB)
- {
- sal_Int32 nTopA = pA->get_grid_top_attach();
- sal_Int32 nTopB = pB->get_grid_top_attach();
- if (nTopA < nTopB)
- return true;
- if (nTopA > nTopB)
- return false;
- sal_Int32 nLeftA = pA->get_grid_left_attach();
- sal_Int32 nLeftB = pB->get_grid_left_attach();
- return nLeftA < nLeftB;
- }
+ //sort child order within parent list by grid position
+ sal_Int32 nTopA = pA->get_grid_top_attach();
+ sal_Int32 nTopB = pB->get_grid_top_attach();
+ if (nTopA < nTopB)
+ return true;
+ if (nTopA > nTopB)
+ return false;
+ sal_Int32 nLeftA = pA->get_grid_left_attach();
+ sal_Int32 nLeftB = pB->get_grid_left_attach();
+ if (nLeftA < nLeftB)
+ return true;
+ if (nLeftA > nLeftB)
+ return false;
+ //sort into two groups of pack start and pack end
+ VclPackType ePackA = pA->get_pack_type();
+ VclPackType ePackB = pB->get_pack_type();
+ if (ePackA < ePackB)
+ return true;
+ if (ePackA > ePackB)
+ return false;
+ //honour relative box positions with pack group
+ return m_pBuilder->get_window_packing_position(pA) < m_pBuilder->get_window_packing_position(pB);
}
void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader)
@@ -943,20 +955,11 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader)
aChilds.push_back(pChild);
}
- //sort child order within parent list by grid position
- //so that tabbing between controls goes in a visually sensible sequence
- std::stable_sort(aChilds.begin(), aChilds.end(), sortByGridPositions);
+ //sort child order within parent so that tabbing
+ //between controls goes in a visually sensible sequence
+ std::stable_sort(aChilds.begin(), aChilds.end(), sortIntoBestTabTraversalOrder(this));
for (size_t i = 0; i < aChilds.size(); ++i)
reorderWithinParent(*aChilds[i], i);
-
- //honour box positions if there is any
- for (size_t i = 0; i < aChilds.size(); ++i)
- {
- sal_Int32 nPosition = get_window_packing_position(aChilds[i]);
- if (nPosition == -1)
- continue;
- reorderWithinParent(*aChilds[i], nPosition);
- }
}
}
}
commit 06e3724d1c166e6715455555788f5b11c310d60a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 5 12:18:07 2012 +0100
convert password dialog to .ui
Change-Id: Ib2e9c5a72239fc0fa3a54ac3717d90fe1b779d63
diff --git a/sfx2/AllLangResTarget_sfx2.mk b/sfx2/AllLangResTarget_sfx2.mk
index 0d16f68..e106455 100644
--- a/sfx2/AllLangResTarget_sfx2.mk
+++ b/sfx2/AllLangResTarget_sfx2.mk
@@ -58,7 +58,6 @@ $(eval $(call gb_SrsTarget_add_files,sfx/res,\
sfx2/source/dialog/mailwindow.src \
sfx2/source/dialog/mgetempl.src \
sfx2/source/dialog/newstyle.src \
- sfx2/source/dialog/passwd.src \
sfx2/source/dialog/printopt.src \
sfx2/source/dialog/recfloat.src \
sfx2/source/dialog/securitypage.src \
diff --git a/sfx2/Module_sfx2.mk b/sfx2/Module_sfx2.mk
index 1e316eb..993ee47 100644
--- a/sfx2/Module_sfx2.mk
+++ b/sfx2/Module_sfx2.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_Module_add_targets,sfx2,\
Library_sfx \
Package_inc \
Package_sdi \
+ UI_sfx \
))
$(eval $(call gb_Module_add_check_targets,sfx2,\
diff --git a/sfx2/UI_sfx.mk b/sfx2/UI_sfx.mk
new file mode 100644
index 0000000..a084da1
--- /dev/null
+++ b/sfx2/UI_sfx.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UI_UI,sfx))
+
+$(eval $(call gb_UI_add_uifiles,sfx,\
+ sfx2/uiconfig/ui/password \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sfx2/inc/sfx2/passwd.hxx b/sfx2/inc/sfx2/passwd.hxx
index 2e07153..d4fd5ee 100644
--- a/sfx2/inc/sfx2/passwd.hxx
+++ b/sfx2/inc/sfx2/passwd.hxx
@@ -34,6 +34,7 @@
#include <vcl/dialog.hxx>
#include <vcl/edit.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
#include <sfx2/app.hxx>
// defines ---------------------------------------------------------------
@@ -50,23 +51,23 @@
class SFX2_DLLPUBLIC SfxPasswordDialog : public ModalDialog
{
private:
- FixedLine maPasswordBox;
- FixedText maUserFT;
- Edit maUserED;
- FixedText maPasswordFT;
- Edit maPasswordED;
- FixedText maConfirmFT;
- Edit maConfirmED;
- FixedText maMinLengthFT;
- FixedLine maPassword2Box;
- FixedText maPassword2FT;
- Edit maPassword2ED;
- FixedText maConfirm2FT;
- Edit maConfirm2ED;
+ VclFrame* mpPassword1Box;
+ FixedText* mpUserFT;
+ Edit* mpUserED;
+ FixedText* mpPassword1FT;
+ Edit* mpPassword1ED;
+ FixedText* mpConfirm1FT;
+ Edit* mpConfirm1ED;
- OKButton maOKBtn;
- CancelButton maCancelBtn;
- HelpButton maHelpBtn;
+ VclFrame* mpPassword2Box;
+ FixedText* mpPassword2FT;
+ Edit* mpPassword2ED;
+ FixedText* mpConfirm2FT;
+ Edit* mpConfirm2ED;
+
+ FixedText* mpMinLengthFT;
+
+ OKButton* mpOKBtn;
String maConfirmStr;
String maMinLenPwdStr;
@@ -76,28 +77,52 @@ private:
sal_uInt16 mnExtras;
bool mbAsciiOnly;
- DECL_DLLPRIVATE_LINK( EditModifyHdl, Edit* );
+ DECL_DLLPRIVATE_LINK(EditModifyHdl, Edit*);
DECL_DLLPRIVATE_LINK(OKHdl, void *);
void SetPasswdText();
public:
- SfxPasswordDialog( Window* pParent, const String* pGroupText = NULL );
-
- String GetUser() const { return maUserED.GetText(); }
- String GetPassword() const { return maPasswordED.GetText(); }
- String GetConfirm() const { return maConfirmED.GetText(); }
-
- String GetPassword2() const { return maPassword2ED.GetText(); }
- String GetConfirm2() const { return maConfirm2ED.GetText(); }
- void SetGroup2Text( const String& i_rText ) { maPassword2Box.SetText( i_rText ); }
-
- void SetMinLen( sal_uInt16 Len );
- void SetEditHelpId( const rtl::OString& rId ) { maPasswordED.SetHelpId( rId ); }
- void ShowExtras( sal_uInt16 nExtras ) { mnExtras = nExtras; }
- void AllowAsciiOnly( bool i_bAsciiOnly = true ) { mbAsciiOnly = i_bAsciiOnly; }
-
- virtual short Execute();
+ SfxPasswordDialog(Window* pParent, const String* pGroupText = NULL);
+
+ String GetUser() const
+ {
+ return mpUserED->GetText();
+ }
+ String GetPassword() const
+ {
+ return mpPassword1ED->GetText();
+ }
+ String GetConfirm() const
+ {
+ return mpConfirm1ED->GetText();
+ }
+ String GetPassword2() const
+ {
+ return mpPassword2ED->GetText();
+ }
+ String GetConfirm2() const
+ {
+ return mpConfirm2ED->GetText();
+ }
+ void SetGroup2Text(const String& i_rText)
+ {
+ mpPassword2Box->set_label(i_rText);
+ }
+ void SetMinLen(sal_uInt16 Len);
+ void SetEditHelpId(const OString& rId)
+ {
+ mpPassword1ED->SetHelpId( rId );
+ }
+ void ShowExtras(sal_uInt16 nExtras)
+ {
+ mnExtras = nExtras;
+ }
+ void AllowAsciiOnly(bool i_bAsciiOnly = true)
+ {
+ mbAsciiOnly = i_bAsciiOnly;
+ }
+ virtual short Execute();
};
#endif // #ifndef _SFX_PASSWD_HXX
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index c215a18..7971b85 100644
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -155,7 +155,7 @@
#define STR_STANDARD (RID_SFX_START+104)
#define STR_READONLY (RID_SFX_START+105)
-#define STR_SFX_FILTERNAME_ALL (RID_SFX_START+106)
+#define STR_SFX_FILTERNAME_ALL (RID_SFX_START+106)
#define STR_EDIT (RID_SFX_START+108)
#define STR_QUERY_SAVE_DOCUMENT (RID_SFX_START+110)
#define STR_BYTES (RID_SFX_START+111)
@@ -166,10 +166,12 @@
#define STR_STANDARD_SHORTCUT (RID_SFX_START+117)
#define STR_REPAIREDDOCUMENT (RID_SFX_START+118)
-
#define STR_ERRUNOEVENTBINDUNG (RID_SFX_START+119)
#define STR_SHARED (RID_SFX_START+120)
#define RID_XMLSEC_DOCUMENTSIGNED (RID_SFX_START+121)
+#define STR_PASSWD (RID_SFX_START+122)
+#define STR_PASSWD_EMPTY (RID_SFX_START+123)
+#define STR_PASSWD_MIN_LEN (RID_SFX_START+124)
#define STR_ACCTITLE_PRODUCTIVITYTOOLS (RID_SFX_START+157)
//=========================================================================
diff --git a/sfx2/source/appl/sfx.src b/sfx2/source/appl/sfx.src
index 0b5c765..1103841 100644
--- a/sfx2/source/appl/sfx.src
+++ b/sfx2/source/appl/sfx.src
@@ -23,3 +23,17 @@ String STR_ACCTITLE_PRODUCTIVITYTOOLS
Text [ en-US ] = "%PRODUCTNAME";
};
+String STR_PASSWD_MIN_LEN
+{
+ Text [ en-US ] = "(Minimum $(MINLEN) characters)" ;
+};
+
+String STR_PASSWD_EMPTY
+{
+ Text [ en-US ] = "(The password can be empty)" ;
+};
+
+String STR_PASSWD
+{
+ Text [ en-US ] = "Password" ;
+};
diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc
index 27a9eab..e27579d 100644
--- a/sfx2/source/dialog/dialog.hrc
+++ b/sfx2/source/dialog/dialog.hrc
@@ -32,7 +32,6 @@
#define RID_DLG_ALIEN_WARNING ( RC_DIALOG_BEGIN + 0)
#define STR_RESET ( RC_DIALOG_BEGIN + 0)
-#define DLG_PASSWD ( RC_DIALOG_BEGIN + 8)
#define STR_TABPAGE_MANAGESTYLES ( RC_DIALOG_BEGIN + 12)
#define MSG_TABPAGE_INVALIDNAME ( RC_DIALOG_BEGIN + 13)
#define MSG_TABPAGE_INVALIDSTYLE ( RC_DIALOG_BEGIN + 14)
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index ae48a48..77dc352 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -35,20 +35,17 @@
#include "sfx2/sfxresid.hxx"
#include "dialog.hrc"
-#include "passwd.hrc"
-
-#include "vcl/arrange.hxx"
// -----------------------------------------------------------------------
IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, pEdit )
{
- if( mbAsciiOnly && (pEdit == &maPasswordED || pEdit == &maPassword2ED) )
+ if (mbAsciiOnly && (pEdit == mpPassword1ED || pEdit == mpPassword2ED))
{
- rtl::OUString aTest( pEdit->GetText() );
+ OUString aTest( pEdit->GetText() );
const sal_Unicode* pTest = aTest.getStr();
sal_Int32 nLen = aTest.getLength();
- rtl::OUStringBuffer aFilter( nLen );
+ OUStringBuffer aFilter( nLen );
bool bReset = false;
for( sal_Int32 i = 0; i < nLen; i++ )
{
@@ -65,10 +62,10 @@ IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, pEdit )
}
}
- bool bEnable = maPasswordED.GetText().Len() >= mnMinLen;
- if( maPassword2ED.IsVisible() )
- bEnable = (bEnable && (maPassword2ED.GetText().Len() >= mnMinLen));
- maOKBtn.Enable( bEnable );
+ bool bEnable = mpPassword1ED->GetText().Len() >= mnMinLen;
+ if( mpPassword2ED->IsVisible() )
+ bEnable = (bEnable && (mpPassword2ED->GetText().Len() >= mnMinLen));
+ mpOKBtn->Enable( bEnable );
return 0;
}
IMPL_LINK_INLINE_END(SfxPasswordDialog, EditModifyHdl, Edit *, pEdit)
@@ -85,8 +82,8 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl)
{
ErrorBox aBox( this, SfxResId( MSG_ERROR_WRONG_CONFIRM ) );
aBox.Execute();
- maConfirmED.SetText( String() );
- maConfirmED.GrabFocus();
+ mpConfirm1ED->SetText( String() );
+ mpConfirm1ED->GrabFocus();
}
else
EndDialog( RET_OK );
@@ -95,103 +92,44 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl)
// CTOR / DTOR -----------------------------------------------------------
-SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText ) :
-
- ModalDialog( pParent, SfxResId ( DLG_PASSWD ) ),
-
- maPasswordBox ( this, SfxResId( GB_PASSWD_PASSWORD ) ),
- maUserFT ( this, SfxResId( FT_PASSWD_USER ) ),
- maUserED ( this, SfxResId( ED_PASSWD_USER ) ),
- maPasswordFT ( this, SfxResId( FT_PASSWD_PASSWORD ) ),
- maPasswordED ( this, SfxResId( ED_PASSWD_PASSWORD ) ),
- maConfirmFT ( this, SfxResId( FT_PASSWD_CONFIRM ) ),
- maConfirmED ( this, SfxResId( ED_PASSWD_CONFIRM ) ),
-
- maMinLengthFT ( this, SfxResId( FT_PASSWD_MINLEN ) ),
- maPassword2Box ( this, 0 ),
- maPassword2FT ( this, SfxResId( FT_PASSWD_PASSWORD2 ) ),
- maPassword2ED ( this, SfxResId( ED_PASSWD_PASSWORD2 ) ),
- maConfirm2FT ( this, SfxResId( FT_PASSWD_CONFIRM2 ) ),
- maConfirm2ED ( this, SfxResId( ED_PASSWD_CONFIRM2 ) ),
- maOKBtn ( this, SfxResId( BTN_PASSWD_OK ) ),
- maCancelBtn ( this, SfxResId( BTN_PASSWD_CANCEL ) ),
- maHelpBtn ( this, SfxResId( BTN_PASSWD_HELP ) ),
-
- maMinLenPwdStr ( SfxResId( STR_PASSWD_MIN_LEN ).toString() ),
- maEmptyPwdStr ( SfxResId( STR_PASSWD_EMPTY ).toString() ),
- maMainPwdStr ( ),
- mnMinLen ( 5 ),
- mnExtras ( 0 ),
- mbAsciiOnly ( false )
-
+SfxPasswordDialog::SfxPasswordDialog(Window* pParent, const String* pGroupText)
+ : ModalDialog(pParent, "PasswordDialog", "sfx/ui/password.ui")
+ , maMinLenPwdStr(SFX2_RESSTR(STR_PASSWD_MIN_LEN))
+ , maEmptyPwdStr(SFX2_RESSTR(STR_PASSWD_EMPTY))
+ , mnMinLen(5)
+ , mnExtras(0)
+ , mbAsciiOnly(false)
{
- maPasswordED.SetAccessibleName(SfxResId(TEXT_PASSWD).toString());
- FreeResource();
-
- // setup layout
- boost::shared_ptr<vcl::RowOrColumn> xLayout =
- boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
- xLayout->setOuterBorder( 0 );
-
- // get edit size, should be used as minimum
- Size aEditSize( maUserED.GetSizePixel() );
-
- // add labelcolumn for the labeled edit fields
- boost::shared_ptr<vcl::LabelColumn> xEdits( new vcl::LabelColumn( xLayout.get() ) );
- size_t nChildIndex = xLayout->addChild( xEdits );
- xLayout->setBorders( nChildIndex, -2, -2, -2, 0 );
+ get(mpPassword1Box, "password1frame");
+ get(mpUserFT, "userft");
+ get(mpUserED, "usered");
+ get(mpPassword1FT, "pass1ft");
+ get(mpPassword1ED, "pass1ed");
+ get(mpConfirm1FT, "confirm1ft");
+ get(mpConfirm1ED, "confirm1ed");
- // add group box
- xEdits->addWindow( &maPasswordBox );
+ get(mpPassword2Box, "password2frame");
+ get(mpPassword2FT, "pass2ft");
+ get(mpPassword2ED, "pass2ed");
+ get(mpConfirm2FT, "confirm2ft");
+ get(mpConfirm2ED, "confirm2ed");
- // add user line
- xEdits->addRow( &maUserFT, &maUserED, -2, aEditSize );
+ get(mpMinLengthFT, "minlenft");
- // add password line
- xEdits->addRow( &maPasswordFT, &maPasswordED, -2, aEditSize );
+ get(mpOKBtn, "ok");
- // add confirm line
- xEdits->addRow( &maConfirmFT, &maConfirmED, -2, aEditSize );
-
- // add second group box
- xEdits->addWindow( &maPassword2Box );
-
- // add second password line
- xEdits->addRow( &maPassword2FT, &maPassword2ED, -2, aEditSize );
-
- // add second confirm line
- xEdits->addRow( &maConfirm2FT, &maConfirm2ED, -2, aEditSize );
-
- // add password length warning line
- xEdits->addWindow( &maMinLengthFT );
-
- // add a FixedLine
- FixedLine* pLine = new FixedLine( this, 0 );
- pLine->Show();
- addWindow( pLine, true );
- xLayout->addWindow( pLine );
-
- // add button column
- Size aBtnSize( maCancelBtn.GetSizePixel() );
- boost::shared_ptr<vcl::RowOrColumn> xButtons( new vcl::RowOrColumn( xLayout.get(), false ) );
- nChildIndex = xLayout->addChild( xButtons );
- xLayout->setBorders( nChildIndex, -2, 0, -2, -2 );
-
- xButtons->addWindow( &maHelpBtn, 0, aBtnSize );
- xButtons->addChild( new vcl::Spacer( xButtons.get() ) );
- xButtons->addWindow( &maOKBtn, 0, aBtnSize );
- xButtons->addWindow( &maCancelBtn, 0, aBtnSize );
+ mpPassword1ED->SetAccessibleName(SFX2_RESSTR(STR_PASSWD));
Link aLink = LINK( this, SfxPasswordDialog, EditModifyHdl );
- maPasswordED.SetModifyHdl( aLink );
- maPassword2ED.SetModifyHdl( aLink );
+ mpPassword1ED->SetModifyHdl( aLink );
+ mpPassword2ED->SetModifyHdl( aLink );
aLink = LINK( this, SfxPasswordDialog, OKHdl );
- maOKBtn.SetClickHdl( aLink );
+ mpOKBtn->SetClickHdl( aLink );
- if ( pGroupText )
- maPasswordBox.SetText( *pGroupText );
+ if (pGroupText)
+ mpPassword1Box->set_label(*pGroupText);
-//set the text to the pasword length
+ //set the text to the pasword length
SetPasswdText();
}
@@ -201,13 +139,12 @@ void SfxPasswordDialog::SetPasswdText( )
{
//set the new string to the minimum password length
if( mnMinLen == 0 )
- maMinLengthFT.SetText( maEmptyPwdStr );
+ mpMinLengthFT->SetText(maEmptyPwdStr);
else
{
maMainPwdStr = maMinLenPwdStr;
- maMainPwdStr.SearchAndReplace( rtl::OUString("$(MINLEN)"), String::CreateFromInt32((sal_Int32) mnMinLen ), 0);
- maMinLengthFT.SetText( maMainPwdStr );
- maMinLengthFT.Show();
+ maMainPwdStr.SearchAndReplace( OUString("$(MINLEN)"), String::CreateFromInt32((sal_Int32) mnMinLen ), 0);
+ mpMinLengthFT->SetText(maMainPwdStr);
}
}
@@ -224,106 +161,42 @@ void SfxPasswordDialog::SetMinLen( sal_uInt16 nLen )
short SfxPasswordDialog::Execute()
{
- maUserFT.Hide();
- maUserED.Hide();
- maConfirmFT.Hide();
- maConfirmED.Hide();
- maPasswordFT.Hide();
- maPassword2Box.Hide();
- maPassword2FT.Hide();
- maPassword2ED.Hide();
- maPassword2FT.Hide();
- maConfirm2FT.Hide();
- maConfirm2ED.Hide();
-
- if( mnExtras != SHOWEXTRAS_NONE )
- maPasswordFT.Show();
- if( (mnExtras & SHOWEXTRAS_USER ) )
+ mpUserFT->Hide();
+ mpUserED->Hide();
+ mpConfirm1FT->Hide();
+ mpConfirm1ED->Hide();
+ mpPassword1FT->Hide();
+ mpPassword2Box->Hide();
+ mpPassword2FT->Hide();
+ mpPassword2ED->Hide();
+ mpPassword2FT->Hide();
+ mpConfirm2FT->Hide();
+ mpConfirm2ED->Hide();
+
+ if (mnExtras != SHOWEXTRAS_NONE)
+ mpPassword1FT->Show();
+ if (mnExtras & SHOWEXTRAS_USER)
{
- //TODO: Inevitably this layout logic will be wrong post merge until we can see the dialog to test it.
- Size a3Size = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
- Size a6Size = LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
- long nMinHeight = maHelpBtn.GetPosPixel().Y() +
- maHelpBtn.GetSizePixel().Height() + a6Size.Height();
- sal_uInt16 nRowHided = 1;
-
- if ( SHOWEXTRAS_NONE == mnExtras )
- {
- maUserFT.Hide();
- maUserED.Hide();
- maConfirmFT.Hide();
- maConfirmED.Hide();
- maPasswordFT.Hide();
-
- Point aPos = maUserFT.GetPosPixel();
- long nEnd = maUserED.GetPosPixel().X() + maUserED.GetSizePixel().Width();
- maPasswordED.SetPosPixel( aPos );
- Size aSize = maPasswordED.GetSizePixel();
- aSize.Width() = nEnd - aPos.X();
- maPasswordED.SetSizePixel( aSize );
-
- nRowHided = 2;
- }
- else if ( SHOWEXTRAS_USER == mnExtras )
- {
- maConfirmFT.Hide();
- maConfirmED.Hide();
- }
- else if ( SHOWEXTRAS_CONFIRM == mnExtras )
- {
- maUserFT.Hide();
- maUserED.Hide();
-
- Point aPwdPos1 = maPasswordFT.GetPosPixel();
- Point aPwdPos2 = maPasswordED.GetPosPixel();
-
- Point aPos = maUserFT.GetPosPixel();
- maPasswordFT.SetPosPixel( aPos );
- aPos = maUserED.GetPosPixel();
- maPasswordED.SetPosPixel( aPos );
-
- aPos = maConfirmFT.GetPosPixel();
- maConfirmFT.SetPosPixel( aPwdPos1 );
- maConfirmED.SetPosPixel( aPwdPos2 );
- maMinLengthFT.SetPosPixel(aPos);
- }
-
- Size aBoxSize = maPasswordBox.GetSizePixel();
- aBoxSize.Height() -= ( nRowHided * maUserED.GetSizePixel().Height() );
- aBoxSize.Height() -= ( nRowHided * a3Size.Height() );
- maPasswordBox.SetSizePixel( aBoxSize );
-
- long nDlgHeight = maPasswordBox.GetPosPixel().Y() + aBoxSize.Height() + a6Size.Height();
- if ( nDlgHeight < nMinHeight )
- nDlgHeight = nMinHeight;
- Size aDlgSize = GetOutputSizePixel();
- aDlgSize.Height() = nDlgHeight;
- SetOutputSizePixel( aDlgSize );
-
- maUserFT.Show();
- maUserED.Show();
+ mpUserFT->Show();
+ mpUserED->Show();
}
- if( (mnExtras & SHOWEXTRAS_CONFIRM ) )
+ if (mnExtras & SHOWEXTRAS_CONFIRM)
{
- maConfirmFT.Show();
- maConfirmED.Show();
+ mpConfirm1FT->Show();
+ mpConfirm1ED->Show();
}
- if( (mnExtras & SHOWEXTRAS_PASSWORD2) )
+ if (mnExtras & SHOWEXTRAS_PASSWORD2)
{
- maPassword2Box.Show();
- maPassword2FT.Show();
- maPassword2ED.Show();
+ mpPassword2Box->Show();
+ mpPassword2FT->Show();
+ mpPassword2ED->Show();
}
- if( (mnExtras & SHOWEXTRAS_CONFIRM2 ) )
+ if (mnExtras & SHOWEXTRAS_CONFIRM2)
{
- maConfirm2FT.Show();
- maConfirm2ED.Show();
+ mpConfirm2FT->Show();
+ mpConfirm2ED->Show();
}
- boost::shared_ptr<vcl::RowOrColumn> xLayout =
- boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() );
- SetSizePixel( xLayout->getOptimalSize( WINDOWSIZE_PREFERRED ) );
-
return ModalDialog::Execute();
}
diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc
deleted file mode 100644
index cea12b5..0000000
--- a/sfx2/source/dialog/passwd.hrc
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _SFX_PASSWD_HRC
-#define _SFX_PASSWD_HRC
-
-// defines ---------------------------------------------------------------
-
-#define GB_PASSWD_PASSWORD 10
-#define FT_PASSWD_USER 11
-#define ED_PASSWD_USER 12
-#define FT_PASSWD_PASSWORD 13
-#define ED_PASSWD_PASSWORD 14
-#define FT_PASSWD_CONFIRM 15
-#define ED_PASSWD_CONFIRM 16
-#define FT_PASSWD_MINLEN 17
-
-#define BTN_PASSWD_OK 20
-#define BTN_PASSWD_CANCEL 21
-#define BTN_PASSWD_HELP 22
-
-#define FT_PASSWD_PASSWORD2 25
-#define ED_PASSWD_PASSWORD2 26
-#define FT_PASSWD_CONFIRM2 27
-#define ED_PASSWD_CONFIRM2 28
-
-#define STR_PASSWD_MIN_LEN 30
-#define STR_PASSWD_EMPTY 31
-
-#define TEXT_PASSWD 32
-
-#endif
-
diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src
deleted file mode 100644
index cc0393f..0000000
--- a/sfx2/source/dialog/passwd.src
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "helpid.hrc"
-#include "dialog.hrc"
-#include "passwd.hrc"
-
- // DLG_PASSWD ------------------------------------------------------------
-ModalDialog DLG_PASSWD
-{
- HelpId = HID_PASSWD ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT( 200, 68 );
- Text [ en-US ] = "Enter Password" ;
- Moveable = TRUE ;
- FixedText FT_PASSWD_USER
- {
- Pos = MAP_APPFONT( 12, 15 );
- Size = MAP_APPFONT( 42, 10 );
- Text [ en-US ] = "~User";
- };
- Edit ED_PASSWD_USER
- {
- HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_USER";
- Border = TRUE;
- Pos = MAP_APPFONT( 57, 14 );
- Size = MAP_APPFONT( 75, 12 );
- };
- FixedText FT_PASSWD_PASSWORD
- {
- Pos = MAP_APPFONT( 12, 30 );
- Size = MAP_APPFONT( 42, 10 );
- Text [ en-US ] = "~Password";
- };
- Edit ED_PASSWD_PASSWORD
- {
- HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_PASSWORD";
- Border = TRUE;
- PassWord = TRUE;
- Pos = MAP_APPFONT( 57, 29 );
- Size = MAP_APPFONT( 75, 12 );
- };
- FixedText FT_PASSWD_CONFIRM
- {
- Pos = MAP_APPFONT( 12, 45 );
- Size = MAP_APPFONT( 42, 10 );
- Text [ en-US ] = "~Confirm";
- };
- Edit ED_PASSWD_CONFIRM
- {
- HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_CONFIRM";
- Border = TRUE;
- PassWord = TRUE;
- Pos = MAP_APPFONT( 57, 44 );
- Size = MAP_APPFONT( 75, 12 );
- };
-
- String STR_PASSWD_MIN_LEN
- {
- Text [ en-US ] = "(Minimum $(MINLEN) characters)" ;
- };
- String STR_PASSWD_EMPTY
- {
- Text [ en-US ] = "(The password can be empty)" ;
- };
-
- FixedText FT_PASSWD_MINLEN
- {
- Pos = MAP_APPFONT(12, 65 );
- Size = MAP_APPFONT( 126, 10 );
- };
-
- FixedLine GB_PASSWD_PASSWORD
- {
- Pos = MAP_APPFONT( 6, 3 );
- Size = MAP_APPFONT( 132, 8 );
- Text [ en-US ] = "Password" ;
- };
- FixedText FT_PASSWD_PASSWORD2
- {
- Pos = MAP_APPFONT( 12, 30 );
- Size = MAP_APPFONT( 42, 10 );
- Text [ en-US ] = "P~assword";
- };
- Edit ED_PASSWD_PASSWORD2
- {
- Border = TRUE;
- PassWord = TRUE;
- Pos = MAP_APPFONT( 57, 29 );
- Size = MAP_APPFONT( 75, 12 );
- };
- FixedText FT_PASSWD_CONFIRM2
- {
- Pos = MAP_APPFONT( 12, 45 );
- Size = MAP_APPFONT( 42, 10 );
- Text [ en-US ] = "Confir~m";
- };
- Edit ED_PASSWD_CONFIRM2
- {
- Border = TRUE;
- PassWord = TRUE;
- Pos = MAP_APPFONT( 57, 44 );
- Size = MAP_APPFONT( 75, 12 );
- };
- OKButton BTN_PASSWD_OK
- {
- Disable = TRUE;
- Pos = MAP_APPFONT( 144, 6 );
- Size = MAP_APPFONT( 50, 14 );
- DefButton = TRUE;
- };
- CancelButton BTN_PASSWD_CANCEL
- {
- Pos = MAP_APPFONT( 144, 23 );
- Size = MAP_APPFONT( 50, 14 );
- };
- HelpButton BTN_PASSWD_HELP
- {
- Pos = MAP_APPFONT( 144, 43 );
- Size = MAP_APPFONT( 50, 14 );
- };
- String TEXT_PASSWD
- {
- Text [ en-US ] = "Password" ;
- };
-
-};
-
diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc
index c8c8ea4..0a1f71f 100644
--- a/sfx2/source/inc/helpid.hrc
+++ b/sfx2/source/inc/helpid.hrc
@@ -23,7 +23,6 @@
// Help-Ids -----------------------------------------------------------------
#define HID_DOCINFO_EDT "SFX2_HID_DOCINFO_EDT"
-#define HID_PASSWD "SFX2_HID_PASSWD"
#define HID_PRINTMONITOR "SFX2_HID_PRINTMONITOR"
#define HID_MANAGE_STYLES "SFX2_HID_MANAGE_STYLES"
#define HID_CONFIG_EVENT "SFX2_HID_CONFIG_EVENT"
diff --git a/sfx2/uiconfig/ui/password.ui b/sfx2/uiconfig/ui/password.ui
new file mode 100644
index 0000000..598535c
--- /dev/null
+++ b/sfx2/uiconfig/ui/password.ui
@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="PasswordDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Enter Password</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="orientation">vertical</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="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">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="ok">
+ <property name="label">gtk-ok</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</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="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</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>
+ </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="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkFrame" id="password1frame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="userft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">User</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="pass1ft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Password</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="confirm1ft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Confirm</property>
+ </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>
+ <child>
+ <object class="GtkEntry" id="usered">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">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="GtkEntry" id="pass1ed">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="editable">False</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">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="confirm1ed">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="editable">False</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">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Password</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="password2frame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="pass2ft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Password</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="confirm2ft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Confirm</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="pass2ed">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="editable">False</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="GtkEntry" id="confirm2ed">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="editable">False</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">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Second Password</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="minlenft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="xpad">6</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">help</action-widget>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>
commit a65f48f375d218b592ba7c17752f9ca86e14bd65
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 4 23:49:03 2012 +0100
I can't see why the hyphenate cmds have toggle entries
because the dialogs are modal ones so no different
than most commands. (Probably cut and paste and few
notice using themes where empty toggles have no
frame and are indistinguisable from non-toggle)
Change-Id: If82b59e7cebb71bc834a48970283b2cf68e5fdf9
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index f9d7057..0350d7d 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -3389,7 +3389,7 @@ SfxVoidItem Hyphenate SID_ENABLE_HYPHENATION
HasCoreId = FALSE,
HasDialog = TRUE,
ReadOnlyDoc = FALSE,
- Toggle = TRUE,
+ Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index 0183a54..2775659 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -3260,7 +3260,7 @@ SfxBoolItem Hyphenation SID_HYPHENATION
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
- Toggle = TRUE,
+ Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 28e0233..8fb9339 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -3528,7 +3528,7 @@ SfxVoidItem Hyphenate FN_HYPHENATE_OPT_DLG
HasCoreId = FALSE,
HasDialog = TRUE,
ReadOnlyDoc = FALSE,
- Toggle = TRUE,
+ Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
commit eef849b8fb396201395ef6913d9c4e161aded88d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 4 23:35:19 2012 +0100
convert hyphenate dialog to .ui
Change-Id: I0025ce0107deaaf6b4698745691c9f0bfddc7c34
diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk
index f3d76a9..6a395fc 100644
--- a/cui/AllLangResTarget_cui.mk
+++ b/cui/AllLangResTarget_cui.mk
@@ -66,7 +66,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\
cui/source/dialogs/hangulhanjadlg.src \
cui/source/dialogs/hlmarkwn.src \
cui/source/dialogs/hyperdlg.src \
- cui/source/dialogs/hyphen.src \
cui/source/dialogs/iconcdlg.src \
cui/source/dialogs/insrc.src \
cui/source/dialogs/multipat.src \
diff --git a/cui/UI_cui.mk b/cui/UI_cui.mk
index 717107d..eb1217c 100644
--- a/cui/UI_cui.mk
+++ b/cui/UI_cui.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_UI_UI,cui))
$(eval $(call gb_UI_add_uifiles,cui,\
cui/uiconfig/ui/charnamepage \
cui/uiconfig/ui/effectspage \
+ cui/uiconfig/ui/hyphenate \
cui/uiconfig/ui/positionpage \
cui/uiconfig/ui/specialcharacters \
cui/uiconfig/ui/thesaurus \
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index 36a5b34..cd0f775 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -18,7 +18,6 @@
*/
#include "hyphen.hxx"
-#include "hyphen.hrc"
#include "cuires.hrc"
#include "dialmgr.hxx"
@@ -36,12 +35,15 @@
#define CUR_HYPH_POS_CHAR '-'
-
-HyphenEdit::HyphenEdit( Window* pParent, const ResId& rResId ) :
- Edit( pParent, rResId )
+HyphenEdit::HyphenEdit(Window* pParent)
+ : Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK)
{
}
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeHyphenEdit(Window *pParent, VclBuilder::stringmap &)
+{
+ return new HyphenEdit(pParent);
+}
void HyphenEdit::KeyInput( const KeyEvent& rKEvt )
{
@@ -75,12 +77,12 @@ void SvxHyphenWordDialog::EnableLRBtn_Impl()
xub_StrLen nLen = aTxt.Len();
xub_StrLen i;
- aRightBtn.Disable();
+ m_pRightBtn->Disable();
for ( i = nOldPos + 2; i < nLen; ++i )
{
if ( aTxt.GetChar( i ) == sal_Unicode( HYPH_POS_CHAR ) )
{
- aRightBtn.Enable();
+ m_pRightBtn->Enable();
break;
}
}
@@ -88,12 +90,12 @@ void SvxHyphenWordDialog::EnableLRBtn_Impl()
DBG_ASSERT(nOldPos < aTxt.Len(), "nOldPos out of range");
if (nOldPos >= aTxt.Len())
nOldPos = aTxt.Len() - 1;
- aLeftBtn.Disable();
+ m_pLeftBtn->Disable();
for ( i = nOldPos; i-- > 0; )
{
if ( aTxt.GetChar( i ) == sal_Unicode( HYPH_POS_CHAR ) )
{
- aLeftBtn.Enable();
+ m_pLeftBtn->Enable();
break;
}
}
@@ -211,7 +213,7 @@ void SvxHyphenWordDialog::InitControls_Impl()
if (xPossHyph.is())
aEditWord = EraseUnusableHyphens_Impl( xPossHyph, nMaxHyphenationPos );
}
- aWordEdit.SetText( aEditWord );
+ m_pWordEdit->SetText( aEditWord );
nOldPos = aEditWord.Len();
SelLeft();
@@ -277,7 +279,7 @@ void SvxHyphenWordDialog::ContinueHyph_Impl( sal_uInt16 nInsPos )
sal_uInt16 SvxHyphenWordDialog::GetHyphIndex_Impl()
{
sal_uInt16 nPos = 0;
- String aTxt( aWordEdit.GetText() );
+ String aTxt( m_pWordEdit->GetText() );
for ( sal_uInt16 i=0 ; i < aTxt.Len(); ++i )
{
@@ -305,9 +307,9 @@ void SvxHyphenWordDialog::SelLeft()
aTxt.SetChar( i, sal_Unicode( CUR_HYPH_POS_CHAR ) );
nOldPos = i;
- aWordEdit.SetText( aTxt );
- aWordEdit.GrabFocus();
- aWordEdit.SetSelection( Selection( i, i + 1 ) );
+ m_pWordEdit->SetText( aTxt );
+ m_pWordEdit->GrabFocus();
+ m_pWordEdit->SetSelection( Selection( i, i + 1 ) );
break;
}
}
@@ -327,9 +329,9 @@ void SvxHyphenWordDialog::SelRight()
aTxt.SetChar( i, sal_Unicode( CUR_HYPH_POS_CHAR ) );
nOldPos = i;
- aWordEdit.SetText( aTxt );
- aWordEdit.GrabFocus();
- aWordEdit.SetSelection( Selection( i, i + 1 ) );
+ m_pWordEdit->SetText( aTxt );
+ m_pWordEdit->GrabFocus();
+ m_pWordEdit->SetSelection( Selection( i, i + 1 ) );
break;
}
}
@@ -443,7 +445,7 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog, Right_Impl)
IMPL_LINK_NOARG(SvxHyphenWordDialog, GetFocusHdl_Impl)
{
- aWordEdit.SetSelection( Selection( nOldPos, nOldPos + 1 ) );
+ m_pWordEdit->SetSelection( Selection( nOldPos, nOldPos + 1 ) );
return 0;
}
@@ -454,37 +456,32 @@ SvxHyphenWordDialog::SvxHyphenWordDialog(
const String &rWord, LanguageType nLang,
Window* pParent,
uno::Reference< linguistic2::XHyphenator > &xHyphen,
- SvxSpellWrapper* pWrapper ) :
-
- SfxModalDialog( pParent, CUI_RES( RID_SVXDLG_HYPHENATE ) ),
-
- aWordFT ( this, CUI_RES( FT_WORD ) ),
- aWordEdit ( this, CUI_RES( ED_WORD ) ),
- aLeftBtn ( this, CUI_RES( BTN_LEFT ) ),
- aRightBtn ( this, CUI_RES( BTN_RIGHT ) ),
- aOkBtn ( this, CUI_RES( BTN_HYPH_CUT ) ),
- aContBtn ( this, CUI_RES( BTN_HYPH_CONTINUE ) ),
- aDelBtn ( this, CUI_RES( BTN_HYPH_DELETE ) ),
- aFLBottom ( this, CUI_RES( FL_BOTTOM ) ),
- aHelpBtn ( this, CUI_RES( BTN_HYPH_HELP ) ),
- aHyphAll ( this, CUI_RES( BTN_HYPH_ALL ) ),
- aCancelBtn ( this, CUI_RES( BTN_HYPH_CANCEL ) ),
- aLabel ( GetText() ),
- pHyphWrapper ( NULL ),
- xHyphenator ( NULL ),
- xPossHyph ( NULL ),
- aActWord ( ),
- nActLanguage ( LANGUAGE_NONE ),
- nMaxHyphenationPos ( 0 ),
- nHyphPos ( 0 ),
- nOldPos ( 0 ),
- nHyphenationPositionsOffset( 0 ),
- bBusy ( sal_False )
+ SvxSpellWrapper* pWrapper)
+ : SfxModalDialog(pParent, "HyphenateDialog", "cui/ui/hyphenate.ui")
+ , pHyphWrapper(NULL)
+ , xHyphenator(NULL)
+ , xPossHyph(NULL)
+ , nActLanguage(LANGUAGE_NONE)
+ , nMaxHyphenationPos(0)
+ , nHyphPos(0)
+ , nOldPos(0)
+ , nHyphenationPositionsOffset(0)
+ , bBusy(sal_False)
{
- aActWord = rWord;
- nActLanguage = nLang;
- xHyphenator = xHyphen;
- pHyphWrapper = pWrapper;
+ get(m_pWordEdit, "worded");
+ get(m_pLeftBtn, "left");
+ get(m_pRightBtn, "right");
+ get(m_pOkBtn, "ok");
+ get(m_pContBtn, "continue");
+ get(m_pDelBtn, "delete");
+ get(m_pHyphAll, "hyphall");
+ get(m_pCloseBtn, "close");
+
+ aLabel = GetText();
+ aActWord = rWord;
+ nActLanguage = nLang;
+ xHyphenator = xHyphen;
+ pHyphWrapper = pWrapper;
uno::Reference< linguistic2::XHyphenatedWord > xHyphWord( pHyphWrapper ?
pHyphWrapper->GetLast() : NULL, uno::UNO_QUERY );
@@ -497,18 +494,16 @@ SvxHyphenWordDialog::SvxHyphenWordDialog(
}
InitControls_Impl();
- aWordEdit.GrabFocus();
-
- aLeftBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, Left_Impl ) );
- aRightBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, Right_Impl ) );
- aOkBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, CutHdl_Impl ) );
- aContBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, ContinueHdl_Impl ) );
- aDelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, DeleteHdl_Impl ) );
- aHyphAll.SetClickHdl( LINK( this, SvxHyphenWordDialog, HyphenateAllHdl_Impl ) );
- aCancelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, CancelHdl_Impl ) );
- aWordEdit.SetGetFocusHdl( LINK( this, SvxHyphenWordDialog, GetFocusHdl_Impl ) );
-
- FreeResource();
+ m_pWordEdit->GrabFocus();
+
+ m_pLeftBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, Left_Impl ) );
+ m_pRightBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, Right_Impl ) );
+ m_pOkBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, CutHdl_Impl ) );
+ m_pContBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, ContinueHdl_Impl ) );
+ m_pDelBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, DeleteHdl_Impl ) );
+ m_pHyphAll->SetClickHdl( LINK( this, SvxHyphenWordDialog, HyphenateAllHdl_Impl ) );
+ m_pCloseBtn->SetClickHdl( LINK( this, SvxHyphenWordDialog, CancelHdl_Impl ) );
+ m_pWordEdit->SetGetFocusHdl( LINK( this, SvxHyphenWordDialog, GetFocusHdl_Impl ) );
SetWindowTitle( nLang );
diff --git a/cui/source/dialogs/hyphen.hrc b/cui/source/dialogs/hyphen.hrc
deleted file mode 100644
index 1c6e376..0000000
--- a/cui/source/dialogs/hyphen.hrc
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _SVX_HYPHEN_HRC
-#define _SVX_HYPHEN_HRC
-
-// defines ------------------------------------------------------------------
-
-#define ED_WORD 10
-#define BTN_LEFT 11
-#define BTN_RIGHT 12
-#define FT_WORD 13
-#define FL_BOTTOM 14
-
-#define BTN_HYPH_CONTINUE 20
-#define BTN_HYPH_DELETE 21
-#define BTN_HYPH_CUT 22
-#define BTN_HYPH_CANCEL 23
-#define BTN_HYPH_HELP 24
-#define BTN_HYPH_ALL 25
-
-#endif
-
diff --git a/cui/source/dialogs/hyphen.src b/cui/source/dialogs/hyphen.src
deleted file mode 100644
index 753bde0..0000000
--- a/cui/source/dialogs/hyphen.src
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "helpid.hrc"
-#include "cuires.hrc"
-#include "hyphen.hrc"
-
-String RID_SVXSTR_HMERR_CHECKINSTALL
-{
- Text [ en-US ] = "is not available for spellchecking\nPlease check your installation and install the desired language\n" ;
-};
-
- // RID_SVXDLG_HYPHENATE --------------------------------------------------
-ModalDialog RID_SVXDLG_HYPHENATE
-{
- HelpId = HID_HYPHENATE ;
- Size = MAP_APPFONT ( 200 , 111 ) ;
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Text [ en-US ] = "Hyphenation" ;
- Moveable = TRUE ;
-
- FixedText FT_WORD
- {
- Pos = MAP_APPFONT ( 5 , 5 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "~Word" ;
- };
- Edit ED_WORD
- {
- HelpID = "cui:Edit:RID_SVXDLG_HYPHENATE:ED_WORD";
- BORDER = TRUE ;
- Pos = MAP_APPFONT ( 5 , 17 ) ;
- Size = MAP_APPFONT ( 132 , 12 ) ;
- TABSTOP = TRUE ;
- LEFT = TRUE ;
- };
- ImageButton BTN_LEFT
- {
- HelpID = "cui:ImageButton:RID_SVXDLG_HYPHENATE:BTN_LEFT";
- Pos = MAP_APPFONT ( 56 , 33 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- TABSTOP = TRUE ;
- SYMBOL = IMAGEBUTTON_ARROW_LEFT ;
- };
- ImageButton BTN_RIGHT
- {
- HelpID = "cui:ImageButton:RID_SVXDLG_HYPHENATE:BTN_RIGHT";
- Pos = MAP_APPFONT ( 75 , 33 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- TABSTOP = TRUE ;
- Symbol = IMAGEBUTTON_ARROW_RIGHT ;
- };
- OKButton BTN_HYPH_CUT
- {
- Pos = MAP_APPFONT ( 144 , 17 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "H~yphenate" ;
- TABSTOP = TRUE ;
- DEFBUTTON = TRUE ;
- };
- PushButton BTN_HYPH_CONTINUE
- {
- HelpID = "cui:PushButton:RID_SVXDLG_HYPHENATE:BTN_HYPH_CONTINUE";
- Pos = MAP_APPFONT ( 144 , 35 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Skip" ;
- TABSTOP = TRUE ;
- };
- PushButton BTN_HYPH_DELETE
- {
- HelpID = "cui:PushButton:RID_SVXDLG_HYPHENATE:BTN_HYPH_DELETE";
- Pos = MAP_APPFONT ( 144 , 52 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Remove" ;
- TABSTOP = TRUE ;
- };
- FixedLine FL_BOTTOM
- {
- Pos = MAP_APPFONT ( 0 , 81 ) ;
- Size = MAP_APPFONT ( 200 , 8 ) ;
- };
- HelpButton BTN_HYPH_HELP
- {
- Pos = MAP_APPFONT ( 5 , 93 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TABSTOP = TRUE ;
- };
- PushButton BTN_HYPH_ALL
- {
- HelpID = "cui:PushButton:RID_SVXDLG_HYPHENATE:BTN_HYPH_ALL";
- Pos = MAP_APPFONT ( 63 , 93 ) ;
- Size = MAP_APPFONT ( 74 , 14 ) ;
- Text [ en-US ] = "Hyphenate ~All" ;
- TABSTOP = TRUE ;
- };
- CancelButton BTN_HYPH_CANCEL
- {
- Pos = MAP_APPFONT ( 144 , 93 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Close";
- TABSTOP = TRUE ;
- };
-};
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index 24cd468..0345486 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -201,8 +201,6 @@
#define RID_SVX_WND_COMMON_LINGU ( RID_SVX_START + 0 )
#define RID_SVX_GRFFILTER_DLG_EMBOSS_TAB (RID_SVX_START + 337)
#define RID_SVXDLG_SEARCHATTR (RID_SVX_START + 22)
-#define RID_SVXDLG_HYPHENATE (RID_SVX_START + 30)
-#define RID_SVXSTR_HMERR_CHECKINSTALL (RID_SVX_START + 94)
// hyperlink dialog
#define RID_SVXDLG_NEWHYPERLINK (RID_SVX_START + 227)
diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc
index a21f970..38ed220 100644
--- a/cui/source/inc/helpid.hrc
+++ b/cui/source/inc/helpid.hrc
@@ -342,7 +342,6 @@
#define HID_PAGE_TEXTATTR "CUI_HID_PAGE_TEXTATTR"
#define HID_TEXTATTR_CTL_POSITION "CUI_HID_TEXTATTR_CTL_POSITION"
#define HID_TRANS_POSITION_SIZE "CUI_HID_TRANS_POSITION_SIZE"
-#define HID_HYPHENATE "CUI_HID_HYPHENATE"
#define HID_SVXPAGE_CHAR_NAME "CUI_HID_SVXPAGE_CHAR_NAME"
#define HID_HYPERLINK_INTERNET "CUI_HID_HYPERLINK_INTERNET"
#define HID_HYPERLINK_MAIL "CUI_HID_HYPERLINK_MAIL"
diff --git a/cui/source/inc/hyphen.hxx b/cui/source/inc/hyphen.hxx
index 5309657..73c95b3 100644
--- a/cui/source/inc/hyphen.hxx
+++ b/cui/source/inc/hyphen.hxx
@@ -36,27 +36,22 @@ class SvxSpellWrapper;
class HyphenEdit : public Edit
{
public:
- HyphenEdit( Window* pParent, const ResId& rResId );
+ HyphenEdit(Window* pParent);
protected:
- virtual void KeyInput( const KeyEvent &rKEvt );
+ virtual void KeyInput(const KeyEvent &rKEvt);
};
-// class SvxHyphenWordDialog ---------------------------------------------
-
class SvxHyphenWordDialog : public SfxModalDialog
{
- FixedText aWordFT;
- HyphenEdit aWordEdit;
- ImageButton aLeftBtn;
- ImageButton aRightBtn;
- OKButton aOkBtn;
- PushButton aContBtn;
- PushButton aDelBtn;
- FixedLine aFLBottom;
- HelpButton aHelpBtn;
- PushButton aHyphAll;
- CancelButton aCancelBtn;
+ HyphenEdit* m_pWordEdit;
+ PushButton* m_pLeftBtn;
+ PushButton* m_pRightBtn;
+ PushButton* m_pOkBtn;
+ PushButton* m_pContBtn;
+ PushButton* m_pDelBtn;
+ PushButton* m_pHyphAll;
+ PushButton* m_pCloseBtn;
String aLabel;
SvxSpellWrapper* pHyphWrapper;
uno::Reference< linguistic2::XHyphenator > xHyphenator;
diff --git a/cui/uiconfig/ui/hyphenate.ui b/cui/uiconfig/ui/hyphenate.ui
new file mode 100644
index 0000000..15e0f86
--- /dev/null
+++ b/cui/uiconfig/ui/hyphenate.ui
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="HyphenateDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Hyphenation</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="orientation">vertical</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="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <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">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="hyphall">
+ <property name="label" translatable="yes">Hyphenate All</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">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="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">2</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="margin_bottom">18</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Word</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="cuilo:HyphenEdit" id="worded">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label" translatable="yes">Hyphenate</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="continue">
+ <property name="label" translatable="yes">Skip</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="delete">
+ <property name="label">gtk-remove</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="left_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="left">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">end</property>
+ <property name="image">image1</property>
+ </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>
+ <child>
+ <object class="GtkButton" id="right">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">start</property>
+ <property name="image">image2</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">button1</action-widget>
+ <action-widget response="0">hyphall</action-widget>
+ <action-widget response="0">close</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-go-back</property>
+ </object>
+ <object class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-go-forward</property>
+ </object>
+</interface>
commit 3479c1fb010df54ef675413d8b3659a8d619388d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 4 23:02:48 2012 +0100
de-pimpl Hyphenation Dialog for simplicity
Change-Id: Icba94fdd75d5e09fd81744d2f5ce55886b8777b4
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index 4b33b04..36a5b34 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -31,36 +31,19 @@
#include <tools/shl.hxx>
#include <vcl/msgbox.hxx>
-#include <com/sun/star/linguistic2/XPossibleHyphens.hpp>
-
-using namespace ::com::sun::star;
-
-
#define HYPH_POS_CHAR '='
#define CONTINUE_HYPH USHRT_MAX
#define CUR_HYPH_POS_CHAR '-'
-// class HyphenEdit_Impl -------------------------------------------------------
-
-class HyphenEdit_Impl : public Edit
-{
-public:
- HyphenEdit_Impl( Window* pParent, const ResId& rResId );
-
-protected:
- virtual void KeyInput( const KeyEvent &rKEvt );
-};
-
-
-HyphenEdit_Impl::HyphenEdit_Impl( Window* pParent, const ResId& rResId ) :
+HyphenEdit::HyphenEdit( Window* pParent, const ResId& rResId ) :
Edit( pParent, rResId )
{
}
-void HyphenEdit_Impl::KeyInput( const KeyEvent& rKEvt )
+void HyphenEdit::KeyInput( const KeyEvent& rKEvt )
{
sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
@@ -86,132 +69,7 @@ void HyphenEdit_Impl::KeyInput( const KeyEvent& rKEvt )
}
-// struct SvxHyphenWordDialog_Impl ---------------------------------------------
-
-struct SvxHyphenWordDialog_Impl
-{
- SvxHyphenWordDialog * m_pDialog;
-
- FixedText aWordFT;
- HyphenEdit_Impl aWordEdit;
- ImageButton aLeftBtn;
- ImageButton aRightBtn;
- OKButton aOkBtn;
- PushButton aContBtn;
- PushButton aDelBtn;
- FixedLine aFLBottom;
- HelpButton aHelpBtn;
- PushButton aHyphAll;
- CancelButton aCancelBtn;
- String aLabel;
- SvxSpellWrapper* pHyphWrapper;
- uno::Reference< linguistic2::XHyphenator > xHyphenator;
- uno::Reference< linguistic2::XPossibleHyphens > xPossHyph;
- String aEditWord; // aEditWord and aWordEdit.GetText() differ only by the character for the current selected hyphenation position
- String aActWord; // actual word to be hyphenated
- LanguageType nActLanguage; // and its language
- sal_uInt16 nMaxHyphenationPos; // right most valid hyphenation pos
- sal_uInt16 nHyphPos;
- sal_uInt16 nOldPos;
- sal_Int32 nHyphenationPositionsOffset;
- sal_Bool bBusy;
-
-
- void EnableLRBtn_Impl();
- String EraseUnusableHyphens_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XPossibleHyphens > &rxPossHyph, sal_uInt16 nMaxHyphenationPos );
-
- void InitControls_Impl();
- void ContinueHyph_Impl( sal_uInt16 nInsPos = 0 );
- sal_uInt16 GetHyphIndex_Impl();
- void SelLeft_Impl();
- void SelRight_Impl();
-
- DECL_LINK(Left_Impl, void *);
- DECL_LINK(Right_Impl, void *);
- DECL_LINK(CutHdl_Impl, void *);
- DECL_LINK(ContinueHdl_Impl, void *);
- DECL_LINK(DeleteHdl_Impl, void *);
- DECL_LINK( HyphenateAllHdl_Impl, Button* );
- DECL_LINK(CancelHdl_Impl, void *);
- DECL_LINK(GetFocusHdl_Impl, void *);
-
-
- SvxHyphenWordDialog_Impl(
- SvxHyphenWordDialog * pDialog,
- const String &rWord,
- LanguageType nLang,
- uno::Reference< linguistic2::XHyphenator > &xHyphen,
- SvxSpellWrapper* pWrapper );
- ~SvxHyphenWordDialog_Impl();
-};
-
-
-SvxHyphenWordDialog_Impl::SvxHyphenWordDialog_Impl(
- SvxHyphenWordDialog * pDialog,
- const String &rWord,
- LanguageType nLang,
- uno::Reference< linguistic2::XHyphenator > &xHyphen,
- SvxSpellWrapper* pWrapper ) :
-
- m_pDialog ( pDialog ),
- aWordFT ( pDialog, CUI_RES( FT_WORD ) ),
- aWordEdit ( pDialog, CUI_RES( ED_WORD ) ),
- aLeftBtn ( pDialog, CUI_RES( BTN_LEFT ) ),
- aRightBtn ( pDialog, CUI_RES( BTN_RIGHT ) ),
- aOkBtn ( pDialog, CUI_RES( BTN_HYPH_CUT ) ),
- aContBtn ( pDialog, CUI_RES( BTN_HYPH_CONTINUE ) ),
- aDelBtn ( pDialog, CUI_RES( BTN_HYPH_DELETE ) ),
- aFLBottom ( pDialog, CUI_RES( FL_BOTTOM ) ),
- aHelpBtn ( pDialog, CUI_RES( BTN_HYPH_HELP ) ),
- aHyphAll ( pDialog, CUI_RES( BTN_HYPH_ALL ) ),
- aCancelBtn ( pDialog, CUI_RES( BTN_HYPH_CANCEL ) ),
- aLabel ( pDialog->GetText() ),
- pHyphWrapper ( NULL ),
- xHyphenator ( NULL ),
- xPossHyph ( NULL ),
- aActWord ( ),
- nActLanguage ( LANGUAGE_NONE ),
- nMaxHyphenationPos ( 0 ),
- nHyphPos ( 0 ),
- nOldPos ( 0 ),
- nHyphenationPositionsOffset( 0 ),
- bBusy ( sal_False )
-{
- aActWord = rWord;
- nActLanguage = nLang;
- xHyphenator = xHyphen;
- pHyphWrapper = pWrapper;
-
- uno::Reference< linguistic2::XHyphenatedWord > xHyphWord( pHyphWrapper ?
- pHyphWrapper->GetLast() : NULL, uno::UNO_QUERY );
- DBG_ASSERT( xHyphWord.is(), "hyphenation result missing" );
- if (xHyphWord.is())
- {
- DBG_ASSERT( aActWord == String( xHyphWord->getWord() ), "word mismatch" );
- DBG_ASSERT( nActLanguage == SvxLocaleToLanguage( xHyphWord->getLocale() ), "language mismatch" );
- nMaxHyphenationPos = xHyphWord->getHyphenationPos();
- }
-
- InitControls_Impl();
- aWordEdit.GrabFocus();
-
- aLeftBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog_Impl, Left_Impl ) );
- aRightBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog_Impl, Right_Impl ) );
- aOkBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog_Impl, CutHdl_Impl ) );
- aContBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog_Impl, ContinueHdl_Impl ) );
- aDelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog_Impl, DeleteHdl_Impl ) );
- aHyphAll.SetClickHdl( LINK( this, SvxHyphenWordDialog_Impl, HyphenateAllHdl_Impl ) );
- aCancelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog_Impl, CancelHdl_Impl ) );
- aWordEdit.SetGetFocusHdl( LINK( this, SvxHyphenWordDialog_Impl, GetFocusHdl_Impl ) );
-}
-
-
-SvxHyphenWordDialog_Impl::~SvxHyphenWordDialog_Impl()
-{
-}
-
-
-void SvxHyphenWordDialog_Impl::EnableLRBtn_Impl()
+void SvxHyphenWordDialog::EnableLRBtn_Impl()
{
String aTxt( aEditWord );
xub_StrLen nLen = aTxt.Len();
@@ -242,7 +100,7 @@ void SvxHyphenWordDialog_Impl::EnableLRBtn_Impl()
}
-String SvxHyphenWordDialog_Impl::EraseUnusableHyphens_Impl(
+String SvxHyphenWordDialog::EraseUnusableHyphens_Impl(
uno::Reference< linguistic2::XPossibleHyphens > &rxPossHyph,
sal_uInt16 _nMaxHyphenationPos )
{
@@ -342,7 +200,7 @@ String SvxHyphenWordDialog_Impl::EraseUnusableHyphens_Impl(
}
-void SvxHyphenWordDialog_Impl::InitControls_Impl()
+void SvxHyphenWordDialog::InitControls_Impl()
{
xPossHyph = NULL;
if (xHyphenator.is())
@@ -356,12 +214,12 @@ void SvxHyphenWordDialog_Impl::InitControls_Impl()
aWordEdit.SetText( aEditWord );
nOldPos = aEditWord.Len();
- SelLeft_Impl();
+ SelLeft();
EnableLRBtn_Impl();
}
-void SvxHyphenWordDialog_Impl::ContinueHyph_Impl( sal_uInt16 nInsPos )
+void SvxHyphenWordDialog::ContinueHyph_Impl( sal_uInt16 nInsPos )
{
if ( nInsPos != CONTINUE_HYPH && xPossHyph.is())
{
@@ -408,15 +266,15 @@ void SvxHyphenWordDialog_Impl::ContinueHyph_Impl( sal_uInt16 nInsPos )
nActLanguage = SvxLocaleToLanguage( xHyphWord->getLocale() );
nMaxHyphenationPos = xHyphWord->getHyphenationPos();
InitControls_Impl();
- m_pDialog->SetWindowTitle( nActLanguage );
+ SetWindowTitle( nActLanguage );
}
}
else
- m_pDialog->EndDialog( RET_OK );
+ EndDialog( RET_OK );
}
-sal_uInt16 SvxHyphenWordDialog_Impl::GetHyphIndex_Impl()
+sal_uInt16 SvxHyphenWordDialog::GetHyphIndex_Impl()
{
sal_uInt16 nPos = 0;
String aTxt( aWordEdit.GetText() );
@@ -433,7 +291,7 @@ sal_uInt16 SvxHyphenWordDialog_Impl::GetHyphIndex_Impl()
}
-void SvxHyphenWordDialog_Impl::SelLeft_Impl()
+void SvxHyphenWordDialog::SelLeft()
{
DBG_ASSERT( nOldPos > 0, "invalid hyphenation position" );
if (nOldPos > 0)
@@ -459,7 +317,7 @@ void SvxHyphenWordDialog_Impl::SelLeft_Impl()
}
-void SvxHyphenWordDialog_Impl::SelRight_Impl()
+void SvxHyphenWordDialog::SelRight()
{
String aTxt( aEditWord );
for ( xub_StrLen i = nOldPos + 1; i < aTxt.Len(); ++i )
@@ -480,7 +338,7 @@ void SvxHyphenWordDialog_Impl::SelRight_Impl()
}
-IMPL_LINK_NOARG(SvxHyphenWordDialog_Impl, CutHdl_Impl)
+IMPL_LINK_NOARG(SvxHyphenWordDialog, CutHdl_Impl)
{
if( !bBusy )
{
@@ -492,7 +350,7 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog_Impl, CutHdl_Impl)
}
-IMPL_LINK( SvxHyphenWordDialog_Impl, HyphenateAllHdl_Impl, Button *, EMPTYARG /*pButton*/ )
+IMPL_LINK( SvxHyphenWordDialog, HyphenateAllHdl_Impl, Button *, EMPTYARG /*pButton*/ )
{
if( !bBusy )
{
@@ -522,7 +380,7 @@ IMPL_LINK( SvxHyphenWordDialog_Impl, HyphenateAllHdl_Impl, Button *, EMPTYARG /*
}
-IMPL_LINK_NOARG(SvxHyphenWordDialog_Impl, DeleteHdl_Impl)
+IMPL_LINK_NOARG(SvxHyphenWordDialog, DeleteHdl_Impl)
{
if( !bBusy )
{
@@ -534,7 +392,7 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog_Impl, DeleteHdl_Impl)
}
-IMPL_LINK_NOARG(SvxHyphenWordDialog_Impl, ContinueHdl_Impl)
+IMPL_LINK_NOARG(SvxHyphenWordDialog, ContinueHdl_Impl)
{
if( !bBusy )
{
@@ -546,44 +404,44 @@ IMPL_LINK_NOARG(SvxHyphenWordDialog_Impl, ContinueHdl_Impl)
}
-IMPL_LINK_NOARG(SvxHyphenWordDialog_Impl, CancelHdl_Impl)
+IMPL_LINK_NOARG(SvxHyphenWordDialog, CancelHdl_Impl)
{
if( !bBusy )
{
bBusy = sal_True;
pHyphWrapper->SpellEnd();
- m_pDialog->EndDialog( RET_CANCEL );
+ EndDialog( RET_CANCEL );
bBusy = sal_False;
}
return 0;
}
-IMPL_LINK_NOARG(SvxHyphenWordDialog_Impl, Left_Impl)
+IMPL_LINK_NOARG(SvxHyphenWordDialog, Left_Impl)
{
if( !bBusy )
{
bBusy = sal_True;
- SelLeft_Impl();
+ SelLeft();
bBusy = sal_False;
}
return 0;
}
-IMPL_LINK_NOARG(SvxHyphenWordDialog_Impl, Right_Impl)
+IMPL_LINK_NOARG(SvxHyphenWordDialog, Right_Impl)
{
if( !bBusy )
{
bBusy = sal_True;
- SelRight_Impl();
+ SelRight();
bBusy = sal_False;
}
return 0;
}
-IMPL_LINK_NOARG(SvxHyphenWordDialog_Impl, GetFocusHdl_Impl)
+IMPL_LINK_NOARG(SvxHyphenWordDialog, GetFocusHdl_Impl)
{
aWordEdit.SetSelection( Selection( nOldPos, nOldPos + 1 ) );
return 0;
@@ -598,17 +456,64 @@ SvxHyphenWordDialog::SvxHyphenWordDialog(
uno::Reference< linguistic2::XHyphenator > &xHyphen,
SvxSpellWrapper* pWrapper ) :
- SfxModalDialog( pParent, CUI_RES( RID_SVXDLG_HYPHENATE ) )
+ SfxModalDialog( pParent, CUI_RES( RID_SVXDLG_HYPHENATE ) ),
+
+ aWordFT ( this, CUI_RES( FT_WORD ) ),
+ aWordEdit ( this, CUI_RES( ED_WORD ) ),
+ aLeftBtn ( this, CUI_RES( BTN_LEFT ) ),
+ aRightBtn ( this, CUI_RES( BTN_RIGHT ) ),
+ aOkBtn ( this, CUI_RES( BTN_HYPH_CUT ) ),
+ aContBtn ( this, CUI_RES( BTN_HYPH_CONTINUE ) ),
+ aDelBtn ( this, CUI_RES( BTN_HYPH_DELETE ) ),
+ aFLBottom ( this, CUI_RES( FL_BOTTOM ) ),
+ aHelpBtn ( this, CUI_RES( BTN_HYPH_HELP ) ),
+ aHyphAll ( this, CUI_RES( BTN_HYPH_ALL ) ),
+ aCancelBtn ( this, CUI_RES( BTN_HYPH_CANCEL ) ),
+ aLabel ( GetText() ),
+ pHyphWrapper ( NULL ),
+ xHyphenator ( NULL ),
+ xPossHyph ( NULL ),
+ aActWord ( ),
+ nActLanguage ( LANGUAGE_NONE ),
+ nMaxHyphenationPos ( 0 ),
+ nHyphPos ( 0 ),
+ nOldPos ( 0 ),
+ nHyphenationPositionsOffset( 0 ),
+ bBusy ( sal_False )
{
- m_pImpl = std::auto_ptr< SvxHyphenWordDialog_Impl >(
- new SvxHyphenWordDialog_Impl( this, rWord, nLang, xHyphen, pWrapper ) );
+ aActWord = rWord;
+ nActLanguage = nLang;
+ xHyphenator = xHyphen;
+ pHyphWrapper = pWrapper;
+
+ uno::Reference< linguistic2::XHyphenatedWord > xHyphWord( pHyphWrapper ?
+ pHyphWrapper->GetLast() : NULL, uno::UNO_QUERY );
+ DBG_ASSERT( xHyphWord.is(), "hyphenation result missing" );
+ if (xHyphWord.is())
+ {
+ DBG_ASSERT( aActWord == String( xHyphWord->getWord() ), "word mismatch" );
+ DBG_ASSERT( nActLanguage == SvxLocaleToLanguage( xHyphWord->getLocale() ), "language mismatch" );
+ nMaxHyphenationPos = xHyphWord->getHyphenationPos();
+ }
+
+ InitControls_Impl();
+ aWordEdit.GrabFocus();
+
+ aLeftBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, Left_Impl ) );
+ aRightBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, Right_Impl ) );
+ aOkBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, CutHdl_Impl ) );
+ aContBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, ContinueHdl_Impl ) );
+ aDelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, DeleteHdl_Impl ) );
+ aHyphAll.SetClickHdl( LINK( this, SvxHyphenWordDialog, HyphenateAllHdl_Impl ) );
+ aCancelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, CancelHdl_Impl ) );
+ aWordEdit.SetGetFocusHdl( LINK( this, SvxHyphenWordDialog, GetFocusHdl_Impl ) );
FreeResource();
SetWindowTitle( nLang );
// disable controls if service is not available
- if (!m_pImpl->xHyphenator.is())
+ if (!xHyphenator.is())
Enable( sal_False );
}
@@ -621,24 +526,11 @@ SvxHyphenWordDialog::~SvxHyphenWordDialog()
void SvxHyphenWordDialog::SetWindowTitle( LanguageType nLang )
{
String aLangStr( SvtLanguageTable::GetLanguageString( nLang ) );
- String aTmp( m_pImpl->aLabel );
+ String aTmp( aLabel );
aTmp.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " (" ) );
aTmp.Append( aLangStr );
aTmp.Append( sal_Unicode( ')' ) );
SetText( aTmp );
}
-
-void SvxHyphenWordDialog::SelLeft()
-{
- m_pImpl->SelLeft_Impl();
-}
-
-
-void SvxHyphenWordDialog::SelRight()
-{
- m_pImpl->SelRight_Impl();
-}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/hyphen.hxx b/cui/source/inc/hyphen.hxx
index 128fb50..5309657 100644
--- a/cui/source/inc/hyphen.hxx
+++ b/cui/source/inc/hyphen.hxx
@@ -26,28 +26,71 @@
#include <vcl/fixed.hxx>
#include <sfx2/basedlgs.hxx>
#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/linguistic2/XHyphenator.hpp>
+#include <com/sun/star/linguistic2/XPossibleHyphens.hpp>
-// forward ---------------------------------------------------------------
-
-namespace com{namespace sun{namespace star{
-namespace linguistic2{
- class XHyphenator;
-}}}}
+using namespace ::com::sun::star;
class SvxSpellWrapper;
-// class SvxHyphenWordDialog ---------------------------------------------
+class HyphenEdit : public Edit
+{
+public:
+ HyphenEdit( Window* pParent, const ResId& rResId );
-struct SvxHyphenWordDialog_Impl;
+protected:
+ virtual void KeyInput( const KeyEvent &rKEvt );
+};
+
+// class SvxHyphenWordDialog ---------------------------------------------
class SvxHyphenWordDialog : public SfxModalDialog
{
- std::auto_ptr< SvxHyphenWordDialog_Impl > m_pImpl;
+ FixedText aWordFT;
+ HyphenEdit aWordEdit;
+ ImageButton aLeftBtn;
+ ImageButton aRightBtn;
+ OKButton aOkBtn;
+ PushButton aContBtn;
+ PushButton aDelBtn;
+ FixedLine aFLBottom;
+ HelpButton aHelpBtn;
+ PushButton aHyphAll;
+ CancelButton aCancelBtn;
+ String aLabel;
+ SvxSpellWrapper* pHyphWrapper;
+ uno::Reference< linguistic2::XHyphenator > xHyphenator;
+ uno::Reference< linguistic2::XPossibleHyphens > xPossHyph;
+ String aEditWord; // aEditWord and aWordEdit.GetText() differ only by the character for the current selected hyphenation position
+ String aActWord; // actual word to be hyphenated
+ LanguageType nActLanguage; // and its language
+ sal_uInt16 nMaxHyphenationPos; // right most valid hyphenation pos
+ sal_uInt16 nHyphPos;
+ sal_uInt16 nOldPos;
+ sal_Int32 nHyphenationPositionsOffset;
+ sal_Bool bBusy;
+
+
+ void EnableLRBtn_Impl();
+ String EraseUnusableHyphens_Impl( uno::Reference< linguistic2::XPossibleHyphens > &rxPossHyph, sal_uInt16 nMaxHyphenationPos );
+
+ void InitControls_Impl();
+ void ContinueHyph_Impl( sal_uInt16 nInsPos = 0 );
+ sal_uInt16 GetHyphIndex_Impl();
+
+ DECL_LINK(Left_Impl, void *);
+ DECL_LINK(Right_Impl, void *);
+ DECL_LINK(CutHdl_Impl, void *);
+ DECL_LINK(ContinueHdl_Impl, void *);
+ DECL_LINK(DeleteHdl_Impl, void *);
+ DECL_LINK( HyphenateAllHdl_Impl, Button* );
+ DECL_LINK(CancelHdl_Impl, void *);
+ DECL_LINK(GetFocusHdl_Impl, void *);
public:
SvxHyphenWordDialog( const String &rWord, LanguageType nLang,
Window* pParent,
- ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > &xHyphen,
+ uno::Reference< linguistic2::XHyphenator > &xHyphen,
SvxSpellWrapper* pWrapper );
virtual ~SvxHyphenWordDialog();
commit d559ffe0513ec9f4ffc3ba8d857f8644fd9b1ada
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 4 21:14:50 2012 +0100
add stock "remove" text
Change-Id: I945a46a8ca3df8c6cf7982a531025d8d8b6c31a4
diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc
index 76fc51f..4951c5c 100644
--- a/vcl/inc/svids.hrc
+++ b/vcl/inc/svids.hrc
@@ -150,6 +150,7 @@
#define SV_BUTTONTEXT_RESET 10111
#define SV_BUTTONTEXT_ADD 10112
#define SV_BUTTONTEXT_DELETE 10113
+#define SV_BUTTONTEXT_REMOVE 10114
#define SV_STDTEXT_FIRST SV_STDTEXT_SERVICENOTAVAILABLE
#define SV_STDTEXT_SERVICENOTAVAILABLE 10200
diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src
index 088b779..d415a1f 100644
--- a/vcl/source/src/btntext.src
+++ b/vcl/source/src/btntext.src
@@ -91,3 +91,8 @@ String SV_BUTTONTEXT_DELETE
{
Text [ en-US ] = "~Delete";
};
+
+String SV_BUTTONTEXT_REMOVE
+{
+ Text [ en-US ] = "~Remove";
+};
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 3ef8289..e421320 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -231,7 +231,7 @@ namespace
OString extractPattern(VclBuilder::stringmap &rMap)
{
OString sPattern;
- VclBuilder::stringmap::iterator aFind = rMap.find(OString(RTL_CONSTASCII_STRINGPARAM("pattern")));
+ VclBuilder::stringmap::iterator aFind = rMap.find(OString("pattern"));
if (aFind != rMap.end())
{
sPattern = aFind->second;
@@ -270,7 +270,7 @@ namespace
VclBuilder::stringmap::iterator aFind = rMap.find(OString("orientation"));
if (aFind != rMap.end())
{
- bVertical = aFind->second.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("vertical"));
+ bVertical = aFind->second.equalsIgnoreAsciiCase("vertical");
rMap.erase(aFind);
}
return bVertical;
@@ -279,7 +279,7 @@ namespace
bool extractInconsistent(VclBuilder::stringmap &rMap)
{
bool bInconsistent = false;
- VclBuilder::stringmap::iterator aFind = rMap.find(OString(RTL_CONSTASCII_STRINGPARAM("inconsistent")));
+ VclBuilder::stringmap::iterator aFind = rMap.find(OString("inconsistent"));
if (aFind != rMap.end())
{
bInconsistent = toBool(aFind->second);
@@ -293,7 +293,7 @@ namespace
WinBits nBits = WB_CENTER|WB_VCENTER|WB_3DLOOK;
bool bIsStock = false;
- VclBuilder::stringmap::iterator aFind = rMap.find(OString(RTL_CONSTASCII_STRINGPARAM("use-stock")));
+ VclBuilder::stringmap::iterator aFind = rMap.find(OString("use-stock"));
if (aFind != rMap.end())
{
bIsStock = toBool(aFind->second);
@@ -305,55 +305,61 @@ namespace
if (bIsStock)
{
OString sType;
- aFind = rMap.find(OString(RTL_CONSTASCII_STRINGPARAM("label")));
+ aFind = rMap.find(OString("label"));
if (aFind != rMap.end())
{
sType = aFind->second;
rMap.erase(aFind);
}
- if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-ok")))
+ if (sType == "gtk-ok")
pWindow = new OKButton(pParent, nBits);
- else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-cancel")))
+ else if (sType == "gtk-cancel")
pWindow = new CancelButton(pParent, nBits);
- else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-help")))
+ else if (sType == "gtk-help")
pWindow = new HelpButton(pParent, nBits);
- else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-media-next")))
+ else if (sType == "gtk-media-next")
{
PushButton *pBtn = new PushButton(pParent, nBits);
pBtn->SetSymbol(SYMBOL_NEXT);
pWindow = pBtn;
}
- else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-media-previous")))
+ else if (sType == "gtk-media-previous")
{
PushButton *pBtn = new PushButton(pParent, nBits);
pBtn->SetSymbol(SYMBOL_PREV);
pWindow = pBtn;
}
- else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-close")))
+ else if (sType == "gtk-close")
{
PushButton *pBtn = new PushButton(pParent, nBits);
pBtn->SetText(VclResId(SV_BUTTONTEXT_CLOSE).toString());
pWindow = pBtn;
}
- else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-revert-to-saved")))
+ else if (sType == "gtk-revert-to-saved")
{
PushButton *pBtn = new PushButton(pParent, nBits);
pBtn->SetText(VclResId(SV_BUTTONTEXT_RESET).toString());
pWindow = pBtn;
}
- else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-add")))
+ else if (sType == "gtk-add")
{
PushButton *pBtn = new PushButton(pParent, nBits);
pBtn->SetText(VclResId(SV_BUTTONTEXT_ADD).toString());
pWindow = pBtn;
}
- else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-delete")))
+ else if (sType == "gtk-delete")
{
PushButton *pBtn = new PushButton(pParent, nBits);
pBtn->SetText(VclResId(SV_BUTTONTEXT_DELETE).toString());
pWindow = pBtn;
}
+ else if (sType == "gtk-remove")
+ {
+ PushButton *pBtn = new PushButton(pParent, nBits);
+ pBtn->SetText(VclResId(SV_BUTTONTEXT_REMOVE).toString());
+ pWindow = pBtn;
+ }
else
{
SAL_WARN("vcl.layout", "unknown stock type: " << sType.getStr());
@@ -401,7 +407,7 @@ namespace
void ensureDefaultWidthChars(VclBuilder::stringmap &rMap)
{
- OString sWidthChars(RTL_CONSTASCII_STRINGPARAM("width-chars"));
+ OString sWidthChars("width-chars");
VclBuilder::stringmap::iterator aFind = rMap.find(sWidthChars);
if (aFind == rMap.end())
rMap[sWidthChars] = "25";
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list