diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-17 17:19:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-18 10:06:04 +0100 |
commit | 61a690cd79a0c1412d8432a62d48632b5c2adc80 (patch) | |
tree | 7b806716a6fb59437886519d76f9a966a80fbb2c /cui | |
parent | e35b772e44096c3a5d1077df7b243fae08e33621 (diff) |
convert autocorrect replace to to .ui
Change-Id: Id1ea4f5e5f003b4c5c405556a2951943a5ed4fb2
Diffstat (limited to 'cui')
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/source/inc/autocdlg.hxx | 22 | ||||
-rw-r--r-- | cui/source/inc/cuires.hrc | 2 | ||||
-rw-r--r-- | cui/source/inc/helpid.hrc | 1 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 213 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.src | 79 | ||||
-rw-r--r-- | cui/uiconfig/ui/acorreplacepage.ui | 186 |
7 files changed, 308 insertions, 196 deletions
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 7afa2dfae932..61d0b1563cfa 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,cui)) $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/aboutdialog \ + cui/uiconfig/ui/acorreplacepage \ cui/uiconfig/ui/asiantypography \ cui/uiconfig/ui/autocorrectdialog \ cui/uiconfig/ui/backgroundpage \ diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index 91062f1f8f70..653c0756e6e1 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -196,6 +196,8 @@ class AutoCorrEdit : public Edit public: AutoCorrEdit(Window* pParent, const ResId& rResId) : Edit(pParent, rResId), bSpaces(sal_False){} + AutoCorrEdit(Window* pParent) : + Edit(pParent), bSpaces(sal_False){} void SetActionHdl( const Link& rLink ) { aActionLink = rLink;} @@ -236,17 +238,15 @@ private: StringChangeTable aChangesTable; - CheckBox aTextOnlyCB; - FixedText aShortFT; - AutoCorrEdit aShortED; - FixedText aReplaceFT; - AutoCorrEdit aReplaceED; - SvTabListBox aReplaceTLB; - PushButton aNewReplacePB; - PushButton aDeleteReplacePB; - - String sModify; - String sNew; + CheckBox* m_pTextOnlyCB; + AutoCorrEdit* m_pShortED; + AutoCorrEdit* m_pReplaceED; + SvTabListBox* m_pReplaceTLB; + PushButton* m_pNewReplacePB; + PushButton* m_pDeleteReplacePB; + + OUString sModify; + OUString sNew; std::set<OUString> aFormatText; DoubleStringTable aDoubleStringTable; diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index e92e13983870..1a013858b551 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -115,7 +115,7 @@ #define RID_OFAPAGE_AUTOCOMPLETE_OPTIONS (RID_OFA_START + 119) #define RID_OFAPAGE_AUTOCORR_OPTIONS (RID_OFA_START + 102) #define RID_OFAPAGE_AUTOFMT_APPLY (RID_OFA_START + 110) -#define RID_OFAPAGE_AUTOCORR_REPLACE (RID_OFA_START + 103) + #define RID_OFAPAGE_AUTOCORR_EXCEPT (RID_OFA_START + 104) #define RID_OFAPAGE_AUTOCORR_QUOTE (RID_OFA_START + 109) #define RID_OFADLG_PRCNT_SET (RID_OFA_START + 111) diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc index 5c6819282729..7d4831814047 100644 --- a/cui/source/inc/helpid.hrc +++ b/cui/source/inc/helpid.hrc @@ -238,7 +238,6 @@ #define HID_TPCOLOR_CMYK_3 "CUI_HID_TPCOLOR_CMYK_3" #define HID_OFAPAGE_AUTOCORR_OPTIONS "CUI_HID_OFAPAGE_AUTOCORR_OPTIONS" #define HID_OFAPAGE_AUTOFMT_OPTIONS "CUI_HID_OFAPAGE_AUTOFMT_OPTIONS" -#define HID_OFAPAGE_AUTOCORR_REPLACE "CUI_HID_OFAPAGE_AUTOCORR_REPLACE" #define HID_OFACTL_AUTOCORR_REPLACE "CUI_HID_OFACTL_AUTOCORR_REPLACE" #define HID_OFAPAGE_AUTOCORR_EXCEPT "CUI_HID_OFAPAGE_AUTOCORR_EXCEPT" #define HID_OFAPAGE_AUTOCORR_QUOTE "CUI_HID_OFAPAGE_AUTOCORR_QUOTE" diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 75fa160df0e3..08cd644bc4ee 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <vcl/builder.hxx> #include <vcl/msgbox.hxx> #include <vcl/field.hxx> #include <vcl/keycodes.hxx> @@ -847,25 +848,24 @@ void OfaACorrCheckListBox::KeyInput( const KeyEvent& rKEvt ) } OfaAutocorrReplacePage::OfaAutocorrReplacePage( Window* pParent, - const SfxItemSet& rSet ) : - SfxTabPage ( pParent, CUI_RES( RID_OFAPAGE_AUTOCORR_REPLACE ), rSet), - aTextOnlyCB ( this, CUI_RES(CB_TEXT_ONLY )), - aShortFT ( this, CUI_RES(FT_SHORT )), - aShortED ( this, CUI_RES(ED_SHORT )), - aReplaceFT ( this, CUI_RES(FT_REPLACE )), - aReplaceED ( this, CUI_RES(ED_REPLACE )), - aReplaceTLB ( this, CUI_RES(TLB_REPLACE )), - aNewReplacePB ( this, CUI_RES(PB_NEW_REPLACE )), - aDeleteReplacePB ( this,CUI_RES(PB_DELETE_REPLACE )), - sModify ( CUI_RES(STR_MODIFY) ), - sNew ( aNewReplacePB.GetText() ), - eLang ( eLastDialogLanguage ), - bHasSelectionText ( sal_False ), - bFirstSelect ( sal_True ), - bReplaceEditChanged ( sal_False ), - bSWriter ( sal_True ) -{ - FreeResource(); + const SfxItemSet& rSet ) + : SfxTabPage(pParent, "AcorReplacePage", "cui/ui/acorreplacepage.ui", rSet) + , eLang(eLastDialogLanguage) + , bHasSelectionText(false) + , bFirstSelect(true) + , bReplaceEditChanged(false) + , bSWriter(true) +{ + get(m_pTextOnlyCB, "textonly"); + get(m_pDeleteReplacePB, "delete"); + get(m_pNewReplacePB, "new"); + sNew = m_pNewReplacePB->GetText(); + sModify = get<PushButton>("replace")->GetText(); + get(m_pShortED, "origtext"); + get(m_pReplaceED, "newtext"); + get(m_pReplaceTLB, "tabview"); + m_pReplaceTLB->set_height_request(16 * GetTextHeight()); + SfxModule *pMod = *(SfxModule**)GetAppData(SHL_WRITER); bSWriter = pMod == SfxModule::GetActiveModule(); @@ -875,20 +875,19 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage( Window* pParent, pCharClass = new CharClass( aLanguageTag ); static long nTabs[] = { 2 /* Tab-Count */, 1, 61 }; - aReplaceTLB.SetTabs( &nTabs[0], MAP_APPFONT ); + m_pReplaceTLB->SetTabs( &nTabs[0], MAP_APPFONT ); - aReplaceTLB.SetStyle( aReplaceTLB.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN ); - aReplaceTLB.SetSelectHdl( LINK(this, OfaAutocorrReplacePage, SelectHdl) ); - aNewReplacePB.SetClickHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl) ); - aDeleteReplacePB.SetClickHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl) ); - aShortED.SetModifyHdl( LINK(this, OfaAutocorrReplacePage, ModifyHdl) ); - aReplaceED.SetModifyHdl( LINK(this, OfaAutocorrReplacePage, ModifyHdl) ); - aShortED.SetActionHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl) ); - aReplaceED.SetActionHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl) ); + m_pReplaceTLB->SetStyle( m_pReplaceTLB->GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN ); + m_pReplaceTLB->SetSelectHdl( LINK(this, OfaAutocorrReplacePage, SelectHdl) ); + m_pNewReplacePB->SetClickHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl) ); + m_pDeleteReplacePB->SetClickHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl) ); + m_pShortED->SetModifyHdl( LINK(this, OfaAutocorrReplacePage, ModifyHdl) ); + m_pReplaceED->SetModifyHdl( LINK(this, OfaAutocorrReplacePage, ModifyHdl) ); + m_pShortED->SetActionHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl) ); + m_pReplaceED->SetActionHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl) ); - aReplaceED.SetSpaces( sal_True ); - aShortED.SetSpaces( sal_True ); - aShortED.SetMaxTextLen( 30 ); + m_pReplaceED->SetSpaces( sal_True ); + m_pShortED->SetSpaces( sal_True ); } OfaAutocorrReplacePage::~OfaAutocorrReplacePage() @@ -970,20 +969,20 @@ void OfaAutocorrReplacePage::RefillReplaceBox(sal_Bool bFromReset, pArray = &aDoubleStringTable[eOldLanguage]; // create new array } - sal_uInt32 nListBoxCount = (sal_uInt32) aReplaceTLB.GetEntryCount(); + sal_uInt32 nListBoxCount = (sal_uInt32) m_pReplaceTLB->GetEntryCount(); sal_uInt32 i; for(i = 0; i < nListBoxCount; i++) { pArray->push_back(DoubleString()); DoubleString& rDouble = (*pArray)[pArray->size() - 1]; - SvTreeListEntry* pEntry = aReplaceTLB.GetEntry( i ); - rDouble.sShort = aReplaceTLB.GetEntryText(pEntry, 0); - rDouble.sLong = aReplaceTLB.GetEntryText(pEntry, 1); + SvTreeListEntry* pEntry = m_pReplaceTLB->GetEntry( i ); + rDouble.sShort = m_pReplaceTLB->GetEntryText(pEntry, 0); + rDouble.sLong = m_pReplaceTLB->GetEntryText(pEntry, 1); rDouble.pUserData = pEntry->GetUserData(); } } - aReplaceTLB.Clear(); + m_pReplaceTLB->Clear(); if( !bSWriter ) aFormatText.clear(); @@ -1000,8 +999,8 @@ void OfaAutocorrReplacePage::RefillReplaceBox(sal_Bool bFromReset, String sEntry(rDouble.sShort); sEntry += '\t'; sEntry += rDouble.sLong; - SvTreeListEntry* pEntry = aReplaceTLB.InsertEntry(sEntry); - aTextOnlyCB.Check(bTextOnly); + SvTreeListEntry* pEntry = m_pReplaceTLB->InsertEntry(sEntry); + m_pTextOnlyCB->Check(bTextOnly); if(!bTextOnly) pEntry->SetUserData(rDouble.pUserData); // that means: with format info or even with selection text } @@ -1015,7 +1014,7 @@ void OfaAutocorrReplacePage::RefillReplaceBox(sal_Bool bFromReset, { SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); SvxAutocorrWordList* pWordList = pAutoCorrect->LoadAutocorrWordList(eLang); - aReplaceTLB.SetUpdateMode(sal_False); + m_pReplaceTLB->SetUpdateMode(sal_False); SvxAutocorrWordList::Content aContent = pWordList->getSortedContent(); for( SvxAutocorrWordList::Content::const_iterator it = aContent.begin(); it != aContent.end(); ++it ) @@ -1028,19 +1027,19 @@ void OfaAutocorrReplacePage::RefillReplaceBox(sal_Bool bFromReset, String sEntry(pWordPtr->GetShort()); sEntry += '\t'; sEntry += pWordPtr->GetLong(); - SvTreeListEntry* pEntry = aReplaceTLB.InsertEntry(sEntry); - aTextOnlyCB.Check(pWordPtr->IsTextOnly()); + SvTreeListEntry* pEntry = m_pReplaceTLB->InsertEntry(sEntry); + m_pTextOnlyCB->Check(pWordPtr->IsTextOnly()); if(!bTextOnly) - pEntry->SetUserData(&aTextOnlyCB); // that means: with format info + pEntry->SetUserData(m_pTextOnlyCB); // that means: with format info } else { aFormatText.insert(pWordPtr->GetShort()); } } - aNewReplacePB.Enable(sal_False); - aDeleteReplacePB.Enable(sal_False); - aReplaceTLB.SetUpdateMode(sal_True); + m_pNewReplacePB->Enable(sal_False); + m_pDeleteReplacePB->Enable(sal_False); + m_pReplaceTLB->SetUpdateMode(sal_True); } SfxViewShell* pViewShell = SfxViewShell::Current(); @@ -1048,20 +1047,20 @@ void OfaAutocorrReplacePage::RefillReplaceBox(sal_Bool bFromReset, { bHasSelectionText = sal_True; const String sSelection( pViewShell->GetSelectionText() ); - aReplaceED.SetText( sSelection ); - aTextOnlyCB.Check( !bSWriter ); - aTextOnlyCB.Enable( bSWriter && sSelection.Len() ); + m_pReplaceED->SetText( sSelection ); + m_pTextOnlyCB->Check( !bSWriter ); + m_pTextOnlyCB->Enable( bSWriter && sSelection.Len() ); } else { - aTextOnlyCB.Enable( sal_False ); + m_pTextOnlyCB->Enable( sal_False ); } } void OfaAutocorrReplacePage::Reset( const SfxItemSet& ) { RefillReplaceBox(sal_True, eLang, eLang); - aShortED.GrabFocus(); + m_pShortED->GrabFocus(); } void OfaAutocorrReplacePage::SetLanguage(LanguageType eSet) @@ -1078,7 +1077,7 @@ void OfaAutocorrReplacePage::SetLanguage(LanguageType eSet) pCompareClass = new CollatorWrapper( comphelper::getProcessComponentContext() ); pCompareClass->loadDefaultCollator( aLanguageTag.getLocale(), 0 ); pCharClass = new CharClass( aLanguageTag ); - ModifyHdl(&aShortED); + ModifyHdl(m_pShortED); } } @@ -1090,28 +1089,28 @@ IMPL_LINK(OfaAutocorrReplacePage, SelectHdl, SvTabListBox*, pBox) OUString sTmpShort(pBox->GetEntryText(pEntry, 0)); // if the text is set via ModifyHdl, the cursor is always at the beginning // of a word, although you're editing here - sal_Bool bSameContent = 0 == pCompareClass->compareString( sTmpShort, aShortED.GetText() ); - Selection aSel = aShortED.GetSelection(); - if(aShortED.GetText() != sTmpShort) + sal_Bool bSameContent = 0 == pCompareClass->compareString( sTmpShort, m_pShortED->GetText() ); + Selection aSel = m_pShortED->GetSelection(); + if(m_pShortED->GetText() != sTmpShort) { - aShortED.SetText(sTmpShort); + m_pShortED->SetText(sTmpShort); // if it was only a different notation, the selection has to be set again if(bSameContent) { - aShortED.SetSelection(aSel); + m_pShortED->SetSelection(aSel); } } - aReplaceED.SetText( pBox->GetEntryText(pEntry, 1) ); + m_pReplaceED->SetText( pBox->GetEntryText(pEntry, 1) ); // with UserData there is a Formatinfo - aTextOnlyCB.Check( pEntry->GetUserData() == 0); + m_pTextOnlyCB->Check( pEntry->GetUserData() == 0); } else { bFirstSelect = sal_False; } - aNewReplacePB.Enable(sal_False); - aDeleteReplacePB.Enable(); + m_pNewReplacePB->Enable(sal_False); + m_pDeleteReplacePB->Enable(); return 0; }; @@ -1173,60 +1172,60 @@ void OfaAutocorrReplacePage::DeleteEntry(String sShort, String sLong) IMPL_LINK(OfaAutocorrReplacePage, NewDelHdl, PushButton*, pBtn) { - SvTreeListEntry* pEntry = aReplaceTLB.FirstSelected(); - if( pBtn == &aDeleteReplacePB ) + SvTreeListEntry* pEntry = m_pReplaceTLB->FirstSelected(); + if( pBtn == m_pDeleteReplacePB ) { DBG_ASSERT( pEntry, "no entry selected" ); if( pEntry ) { - DeleteEntry(aReplaceTLB.GetEntryText(pEntry, 0), aReplaceTLB.GetEntryText(pEntry, 1)); - aReplaceTLB.GetModel()->Remove(pEntry); - ModifyHdl(&aShortED); + DeleteEntry(m_pReplaceTLB->GetEntryText(pEntry, 0), m_pReplaceTLB->GetEntryText(pEntry, 1)); + m_pReplaceTLB->GetModel()->Remove(pEntry); + ModifyHdl(m_pShortED); return 0; } } - if(pBtn == &aNewReplacePB || aNewReplacePB.IsEnabled()) + if(pBtn == m_pNewReplacePB || m_pNewReplacePB->IsEnabled()) { - SvTreeListEntry* _pNewEntry = aReplaceTLB.FirstSelected(); - String sEntry(aShortED.GetText()); - if(sEntry.Len() && ( !aReplaceED.GetText().isEmpty() || + SvTreeListEntry* _pNewEntry = m_pReplaceTLB->FirstSelected(); + String sEntry(m_pShortED->GetText()); + if(sEntry.Len() && ( !m_pReplaceED->GetText().isEmpty() || ( bHasSelectionText && bSWriter ) )) { - NewEntry(aShortED.GetText(), aReplaceED.GetText()); - aReplaceTLB.SetUpdateMode(sal_False); + NewEntry(m_pShortED->GetText(), m_pReplaceED->GetText()); + m_pReplaceTLB->SetUpdateMode(sal_False); sal_uInt32 nPos = UINT_MAX; sEntry += '\t'; - sEntry += aReplaceED.GetText(); + sEntry += m_pReplaceED->GetText(); if(_pNewEntry) { - nPos = (sal_uInt32) aReplaceTLB.GetModel()->GetAbsPos(_pNewEntry); - aReplaceTLB.GetModel()->Remove(_pNewEntry); + nPos = (sal_uInt32) m_pReplaceTLB->GetModel()->GetAbsPos(_pNewEntry); + m_pReplaceTLB->GetModel()->Remove(_pNewEntry); } else { sal_uInt32 j; - for( j = 0; j < aReplaceTLB.GetEntryCount(); j++ ) + for( j = 0; j < m_pReplaceTLB->GetEntryCount(); j++ ) { - SvTreeListEntry* pReplaceEntry = aReplaceTLB.GetEntry(j); - if( 0 >= pCompareClass->compareString(sEntry, aReplaceTLB.GetEntryText(pReplaceEntry, 0) ) ) + SvTreeListEntry* pReplaceEntry = m_pReplaceTLB->GetEntry(j); + if( 0 >= pCompareClass->compareString(sEntry, m_pReplaceTLB->GetEntryText(pReplaceEntry, 0) ) ) break; } nPos = j; } - SvTreeListEntry* pInsEntry = aReplaceTLB.InsertEntry( + SvTreeListEntry* pInsEntry = m_pReplaceTLB->InsertEntry( sEntry, static_cast< SvTreeListEntry * >(NULL), false, nPos == UINT_MAX ? LIST_APPEND : nPos); - if( !bReplaceEditChanged && !aTextOnlyCB.IsChecked()) + if( !bReplaceEditChanged && !m_pTextOnlyCB->IsChecked()) { pInsEntry->SetUserData(&bHasSelectionText); // new formatted text } - aReplaceTLB.MakeVisible( pInsEntry ); - aReplaceTLB.SetUpdateMode( sal_True ); + m_pReplaceTLB->MakeVisible( pInsEntry ); + m_pReplaceTLB->SetUpdateMode( sal_True ); // if the request came from the ReplaceEdit, give focus to the ShortEdit - if(aReplaceED.HasFocus()) + if(m_pReplaceED->HasFocus()) { - aShortED.GrabFocus(); + m_pShortED->GrabFocus(); } } } @@ -1236,16 +1235,16 @@ IMPL_LINK(OfaAutocorrReplacePage, NewDelHdl, PushButton*, pBtn) // which means EndDialog() - has to be evaluated in KeyInput return 0; } - ModifyHdl( &aShortED ); + ModifyHdl(m_pShortED); return 1; } IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, Edit*, pEdt) { - SvTreeListEntry* pFirstSel = aReplaceTLB.FirstSelected(); - sal_Bool bShort = pEdt == &aShortED; + SvTreeListEntry* pFirstSel = m_pReplaceTLB->FirstSelected(); + sal_Bool bShort = pEdt == m_pShortED; const String rEntry = pEdt->GetText(); - const String rRepString = aReplaceED.GetText(); + const String rRepString = m_pReplaceED->GetText(); String aWordStr( pCharClass->lowercase( rEntry )); if(bShort) @@ -1255,19 +1254,19 @@ IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, Edit*, pEdt) sal_Bool bFound = sal_False; sal_Bool bTmpSelEntry=sal_False; - for(sal_uInt32 i = 0; i < aReplaceTLB.GetEntryCount(); i++) + for(sal_uInt32 i = 0; i < m_pReplaceTLB->GetEntryCount(); i++) { - SvTreeListEntry* pEntry = aReplaceTLB.GetEntry( i ); - String aTestStr=aReplaceTLB.GetEntryText(pEntry, 0); + SvTreeListEntry* pEntry = m_pReplaceTLB->GetEntry( i ); + String aTestStr=m_pReplaceTLB->GetEntryText(pEntry, 0); if( pCompareClass->compareString(rEntry, aTestStr ) == 0 ) { if( rRepString.Len() ) { bFirstSelect = sal_True; } - aReplaceTLB.SetCurEntry(pEntry); + m_pReplaceTLB->SetCurEntry(pEntry); pFirstSel = pEntry; - aNewReplacePB.SetText(sModify); + m_pNewReplacePB->SetText(sModify); bFound = sal_True; break; } @@ -1276,25 +1275,25 @@ IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, Edit*, pEdt) aTestStr = pCharClass->lowercase( aTestStr ); if( aTestStr.Search(aWordStr) == 0 && !bTmpSelEntry ) { - aReplaceTLB.MakeVisible( pEntry ); + m_pReplaceTLB->MakeVisible( pEntry ); bTmpSelEntry = sal_True; } } } if( !bFound ) { - aReplaceTLB.SelectAll( sal_False ); + m_pReplaceTLB->SelectAll( sal_False ); pFirstSel = 0; - aNewReplacePB.SetText( sNew ); + m_pNewReplacePB->SetText( sNew ); if( bReplaceEditChanged ) - aTextOnlyCB.Enable(sal_False); + m_pTextOnlyCB->Enable(sal_False); } - aDeleteReplacePB.Enable( bFound ); + m_pDeleteReplacePB->Enable( bFound ); } - else if( aReplaceTLB.GetEntryCount() > 0 ) + else if( m_pReplaceTLB->GetEntryCount() > 0 ) { - SvTreeListEntry* pEntry = aReplaceTLB.GetEntry( 0 ); - aReplaceTLB.MakeVisible( pEntry ); + SvTreeListEntry* pEntry = m_pReplaceTLB->GetEntry( 0 ); + m_pReplaceTLB->MakeVisible( pEntry ); } } @@ -1303,16 +1302,16 @@ IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, Edit*, pEdt) bReplaceEditChanged = sal_True; if( pFirstSel ) { - aNewReplacePB.SetText( sModify ); + m_pNewReplacePB->SetText( sModify ); } } - const String& rShortTxt = aShortED.GetText(); + const String& rShortTxt = m_pShortED->GetText(); sal_Bool bEnableNew = rShortTxt.Len() && ( rRepString.Len() || ( bHasSelectionText && bSWriter )) && ( !pFirstSel || rRepString != - aReplaceTLB.GetEntryText( pFirstSel, 1 ) ); + m_pReplaceTLB->GetEntryText( pFirstSel, 1 ) ); if( bEnableNew ) { for(std::set<OUString>::iterator i = aFormatText.begin(); i != aFormatText.end(); ++i) @@ -1324,7 +1323,7 @@ IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, Edit*, pEdt) } } } - aNewReplacePB.Enable( bEnableNew ); + m_pNewReplacePB->Enable( bEnableNew ); return 0; } @@ -1687,6 +1686,12 @@ IMPL_LINK(OfaAutocorrExceptPage, ModifyHdl, Edit*, pEdt) return 0; } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeAutoCorrEdit(Window *pParent, + VclBuilder::stringmap &) +{ + return new AutoCorrEdit(pParent); +} + void AutoCorrEdit::KeyInput( const KeyEvent& rKEvt ) { const KeyCode aKeyCode = rKEvt.GetKeyCode(); diff --git a/cui/source/tabpages/autocdlg.src b/cui/source/tabpages/autocdlg.src index b33cce728ef1..ffb389026d1b 100644 --- a/cui/source/tabpages/autocdlg.src +++ b/cui/source/tabpages/autocdlg.src @@ -212,85 +212,6 @@ ModalDialog RID_OFADLG_PRCNT_SET /**************************************************************************/ /* */ -/* Beschreibung: Ersetzungstabelle */ -/* */ -/**************************************************************************/ -TabPage RID_OFAPAGE_AUTOCORR_REPLACE -{ - HelpId = HID_OFAPAGE_AUTOCORR_REPLACE ; - OutputSize = TRUE ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - SVLook = TRUE ; - Hide = TRUE ; - FixedText FT_SHORT - { - Pos = MAP_APPFONT ( 7 , 3 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "Repla~ce" ; - Left = TRUE ; - }; - Edit ED_SHORT - { - HelpID = "cui:Edit:RID_OFAPAGE_AUTOCORR_REPLACE:ED_SHORT"; - Pos = MAP_APPFONT ( 7 , 13 ) ; - Size = MAP_APPFONT ( 60 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - FixedText FT_REPLACE - { - Pos = MAP_APPFONT ( 71 , 3 ) ; - Size = MAP_APPFONT ( 64 , 8 ) ; - Text [ en-US ] = "~With:" ; - Left = TRUE ; - }; - Edit ED_REPLACE - { - HelpID = "cui:Edit:RID_OFAPAGE_AUTOCORR_REPLACE:ED_REPLACE"; - Pos = MAP_APPFONT ( 71 , 13 ) ; - Size = MAP_APPFONT ( 123 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - CheckBox CB_TEXT_ONLY - { - HelpID = "cui:CheckBox:RID_OFAPAGE_AUTOCORR_REPLACE:CB_TEXT_ONLY"; - Pos = MAP_APPFONT ( 140 , 3 ) ; - Size = MAP_APPFONT ( 108 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Text only" ; - }; - PushButton PB_NEW_REPLACE - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_REPLACE:PB_NEW_REPLACE"; - Pos = MAP_APPFONT ( 198 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~New" ; - }; - PushButton PB_DELETE_REPLACE - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_REPLACE:PB_DELETE_REPLACE"; - Pos = MAP_APPFONT ( 198 , 32 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Delete" ; - }; - Control TLB_REPLACE - { - HelpId = HID_OFACTL_AUTOCORR_REPLACE ; - Pos = MAP_APPFONT ( 7 , 29 ) ; - Size = MAP_APPFONT ( 187 , 150 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - String STR_MODIFY - { - Text [ en-US ] = "~Replace" ; - }; -}; -/**************************************************************************/ -/* */ /* Beschreibung: Ausnahmelisten */ /* */ /**************************************************************************/ diff --git a/cui/uiconfig/ui/acorreplacepage.ui b/cui/uiconfig/ui/acorreplacepage.ui new file mode 100644 index 000000000000..1e81cc9cbdf3 --- /dev/null +++ b/cui/uiconfig/ui/acorreplacepage.ui @@ -0,0 +1,186 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkBox" id="AcorReplacePage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="border_width">6</property> + <property name="spacing">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <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">6</property> + <property name="column_spacing">12</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">Repla_ce</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">origtext</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="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_With:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">newtext</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="GtkCheckButton" id="textonly"> + <property name="label" translatable="yes">_Text only</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="halign">end</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</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="cuilo-AutoCorrEdit" id="origtext"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="max_length">30</property> + <property name="invisible_char">●</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="cuilo-AutoCorrEdit" id="newtext"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="svtlo-SvTabListBox" id="tabview:border"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="Tab List-selection1"/> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButtonBox" id="buttonbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="new"> + <property name="label">gtk-new</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="replace"> + <property name="label" translatable="yes">_Replace</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="use_underline">True</property> + <property name="image_position">right</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="delete"> + <property name="label">gtk-delete</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="position">1</property> + </packing> + </child> + </object> + <object class="GtkSizeGroup" id="sizegroup1"> + <widgets> + <widget name="new"/> + <widget name="replace"/> + <widget name="delete"/> + </widgets> + </object> +</interface> |