summaryrefslogtreecommitdiff
path: root/cui/source/dialogs
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-10-09 18:56:58 +0200
committerMathias Bauer <mba@openoffice.org>2010-10-09 18:56:58 +0200
commit9570f4dffff24b7312f116dd0ef4f7df7ce5bdcc (patch)
tree2bf91ee1cd1adf2c4087798da41696d024c68ac7 /cui/source/dialogs
parent392974f485bc3fcaac472fd9dbd40f9041952e71 (diff)
parent365999b26e80d5b1fb68eb5c075f044cbd8b4d01 (diff)
CWS changehid: resync to m89
Diffstat (limited to 'cui/source/dialogs')
-rwxr-xr-x[-rw-r--r--]cui/source/dialogs/SpellDialog.cxx103
-rw-r--r--cui/source/dialogs/commonlingui.cxx46
-rw-r--r--cui/source/dialogs/commonlingui.hxx12
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx2
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx3
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx11
-rw-r--r--cui/source/dialogs/hldocntp.cxx31
-rw-r--r--cui/source/dialogs/iconcdlg.cxx204
-rw-r--r--cui/source/dialogs/insdlg.cxx5
-rw-r--r--cui/source/dialogs/scriptdlg.cxx67
-rwxr-xr-x[-rw-r--r--]cui/source/dialogs/thesdlg.cxx101
-rwxr-xr-x[-rw-r--r--]cui/source/dialogs/thesdlg.src6
-rwxr-xr-x[-rw-r--r--]cui/source/dialogs/thesdlg_impl.hxx27
-rw-r--r--cui/source/dialogs/zoom.cxx44
14 files changed, 130 insertions, 532 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 303b54688eea..4fde01da986e 100644..100755
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -76,6 +76,8 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::linguistic2;
+using ::rtl::OUString;
+
#define C2U(cChar) ::rtl::OUString::createFromAscii(cChar)
// struct SpellDialog_Impl ---------------------------------------------
@@ -930,7 +932,7 @@ void SpellDialog::SetTitle_Impl(LanguageType nLang)
-----------------------------------------------------------------------*/
void SpellDialog::InitUserDicts()
{
- sal_uInt16 nLang = aLanguageLB.GetSelectLanguage();
+ const LanguageType nLang = aLanguageLB.GetSelectLanguage();
const Reference< XDictionary > *pDic = 0;
@@ -948,51 +950,50 @@ void SpellDialog::InitUserDicts()
pImpl->aDics = xDicList->getDictionaries();
}
- // Benutzerbuecher anzeigen
+ SvtLinguConfig aCfg;
+ const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
+
+ // list suitable dictionaries
+ bool bEnable = false;
const sal_Int32 nSize = pImpl->aDics.getLength();
pDic = pImpl->aDics.getConstArray();
- sal_Int32 i;
delete aAddToDictMB.GetPopupMenu();
PopupMenu* pMenu = new PopupMenu;
- for (i = 0; i < nSize; ++i )
+ pMenu->SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS);
+ USHORT nItemId = 1; // menu items should be enumerated from 1 and not 0
+ for (sal_Int32 i = 0; i < nSize; ++i)
{
- Reference< XDictionary > xDic( pDic[i], UNO_QUERY );
- if (!xDic.is() || SvxGetIgnoreAllList() == xDic)
+ uno::Reference< linguistic2::XDictionary > xDicTmp( pDic[i], uno::UNO_QUERY );
+ if (!xDicTmp.is() || SvxGetIgnoreAllList() == xDicTmp)
continue;
- // add only active and not read-only dictionaries to list
- // from which to choose from
- Reference< frame::XStorable > xStor( xDic, UNO_QUERY );
- if ( xDic->isActive() && (!xStor.is() || !xStor->isReadonly()) )
+ uno::Reference< frame::XStorable > xStor( xDicTmp, uno::UNO_QUERY );
+ LanguageType nActLanguage = SvxLocaleToLanguage( xDicTmp->getLocale() );
+ if( xDicTmp->isActive()
+ && xDicTmp->getDictionaryType() != linguistic2::DictionaryType_NEGATIVE
+ && (nLang == nActLanguage || LANGUAGE_NONE == nActLanguage )
+ && (!xStor.is() || !xStor->isReadonly()) )
{
- sal_Bool bNegativ = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
- pMenu->InsertItem( (USHORT)i + 1, ::GetDicInfoStr( xDic->getName(),
- SvxLocaleToLanguage( xDic->getLocale() ), bNegativ ) );
- }
- }
- aAddToDictMB.SetPopupMenu(pMenu);
-
- aAddToDictMB.Disable();
+ pMenu->InsertItem( nItemId, xDicTmp->getName() );
+ bEnable = sal_True;
- sal_uInt16 k;
- for ( k = 0; k < pMenu->GetItemCount(); ++k )
- {
- sal_uInt16 nId = pMenu->GetItemId(k) - 1;
- sal_Bool bFound = sal_False;
-
- const sal_uInt16 nDicLang = SvxLocaleToLanguage( pDic[nId]->getLocale() );
- const sal_Bool bDicNegativ =
- pDic[nId]->getDictionaryType() == DictionaryType_NEGATIVE;
- // Stimmt die Sprache "uberein, dann enable
- if ((nDicLang == nLang || nDicLang == LANGUAGE_NONE) && !bDicNegativ)
- bFound = sal_True;
+ uno::Reference< lang::XServiceInfo > xSvcInfo( xDicTmp, uno::UNO_QUERY );
+ if (xSvcInfo.is())
+ {
+ OUString aDictionaryImageUrl( aCfg.GetSpellAndGrammarContextDictionaryImage(
+ xSvcInfo->getImplementationName(), bHC) );
+ if (aDictionaryImageUrl.getLength() > 0)
+ {
+ Image aImage( lcl_GetImageFromPngUrl( aDictionaryImageUrl ) );
+ pMenu->SetItemImage( nItemId, aImage );
+ }
+ }
- if (bFound)
- {
- aAddToDictMB.Enable();
- break;
+ ++nItemId;
}
}
+ aAddToDictMB.SetPopupMenu(pMenu);
+ aAddToDictMB.Enable( bEnable );
}
/*-- 20.10.2003 15:31:06---------------------------------------------------
@@ -1000,31 +1001,39 @@ void SpellDialog::InitUserDicts()
IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, pButton )
{
aSentenceED.UndoActionStart( SPELLUNDO_CHANGE_GROUP );
- USHORT nItem = pButton->GetCurItemId();
//GetErrorText() returns the current error even if the text is already
//manually changed
- String sNewWord= aSentenceED.GetErrorText();
+ const String aNewWord= aSentenceED.GetErrorText();
+
+ USHORT nItemId = pButton->GetCurItemId();
+ PopupMenu *pMenu = pButton->GetPopupMenu();
+ String aDicName ( pMenu->GetItemText( nItemId ) );
+
+ uno::Reference< linguistic2::XDictionary > xDic;
+ uno::Reference< linguistic2::XDictionaryList > xDicList( SvxGetDictionaryList() );
+ if (xDicList.is())
+ xDic = xDicList->getDictionaryByName( aDicName );
- Reference< XDictionary > xDic( pImpl->aDics.getConstArray()[ nItem - 1 ], UNO_QUERY );
sal_Int16 nAddRes = DIC_ERR_UNKNOWN;
if (xDic.is())
{
- String sTmpTxt( sNewWord );
- sal_Bool bNegEntry = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
- nAddRes = linguistic::AddEntryToDic( xDic, sTmpTxt, bNegEntry,
- ::rtl::OUString(), LANGUAGE_NONE );
+ nAddRes = linguistic::AddEntryToDic( xDic, aNewWord, FALSE, OUString(), LANGUAGE_NONE );
+ // save modified user-dictionary if it is persistent
+ uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY );
+ if (xSavDic.is())
+ xSavDic->store();
- if(nAddRes == DIC_ERR_NONE)
+ if (nAddRes == DIC_ERR_NONE)
{
SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl(
SPELLUNDO_CHANGE_ADD_TO_DICTIONARY, aDialogUndoLink);
- pAction->SetDictionary(xDic);
- pAction->SetAddedWord(sTmpTxt);
- aSentenceED.AddUndoAction(pAction);
+ pAction->SetDictionary( xDic );
+ pAction->SetAddedWord( aNewWord );
+ aSentenceED.AddUndoAction( pAction );
}
// failed because there is already an entry?
- if (DIC_ERR_NONE != nAddRes && xDic->getEntry( sTmpTxt ).is())
+ if (DIC_ERR_NONE != nAddRes && xDic->getEntry( aNewWord ).is())
nAddRes = DIC_ERR_NONE;
}
if (DIC_ERR_NONE != nAddRes)
@@ -1032,8 +1041,6 @@ IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, pButton )
SvxDicError( this, nAddRes );
return 0; // Nicht weitermachen
}
- // nach dem Aufnehmen ggf. '='-Zeichen entfernen
- sNewWord.EraseAllChars( sal_Unicode( '=' ) );
// go on
SpellContinue_Impl();
diff --git a/cui/source/dialogs/commonlingui.cxx b/cui/source/dialogs/commonlingui.cxx
index f1cc2a869d6a..327ffd4cbc17 100644
--- a/cui/source/dialogs/commonlingui.cxx
+++ b/cui/source/dialogs/commonlingui.cxx
@@ -183,52 +183,6 @@ void SvxCommonLinguisticControl::InsertControlGroup( Window& _rFirstGroupWindow,
// (FirstWindow, LastWindow) was no valid control group
}
-// -----------------------------------------------------------------------
-String SvxCommonLinguisticControl::GetNewEditWord()
-{
- return aNewWordED.GetText();
-}
-
-// -----------------------------------------------------------------------
-void SvxCommonLinguisticControl::SetNewEditWord( const String& _rNew )
-{
- aNewWordED.SetText( _rNew );
-}
-
-//-----------------------------------------------------------------------------
-void SvxCommonLinguisticControl::UpdateIgnoreHelp( )
-{
-
- String aInfoStr( RTL_CONSTASCII_USTRINGPARAM( ": " ) );
- aInfoStr.Append( GetCurrentText() );
-
- String aString = GetNonMnemonicString( aIgnoreAllBtn.GetText() );
- aString.Append( aInfoStr );
- aIgnoreAllBtn.SetQuickHelpText( aString );
-
- aString = GetNonMnemonicString( aIgnoreBtn.GetText() );
- aString.Append( aInfoStr );
- aIgnoreBtn.SetQuickHelpText( aString );
-}
-
-//-----------------------------------------------------------------------------
-void SvxCommonLinguisticControl::UpdateChangesHelp( const String& _rNewText )
-{
- String aInfoStr( RTL_CONSTASCII_USTRINGPARAM( ": " ) );
- aInfoStr.Append( GetCurrentText() );
- aInfoStr.Append( String( RTL_CONSTASCII_USTRINGPARAM( " -> " ) ) );
- aInfoStr.Append( _rNewText );
- // TODO: shouldn't this be part of the resources, for proper localization?
-
- String aString = GetNonMnemonicString( aChangeAllBtn.GetText() );
- aString.Append( aInfoStr );
- aChangeAllBtn.SetQuickHelpText( aString );
-
- aString = GetNonMnemonicString( aChangeBtn.GetText() );
- aString.Append( aInfoStr );
- aChangeBtn.SetQuickHelpText( aString );
-}
-
//-----------------------------------------------------------------------------
void SvxCommonLinguisticControl::Paint( const Rectangle& rRect )
{
diff --git a/cui/source/dialogs/commonlingui.hxx b/cui/source/dialogs/commonlingui.hxx
index 04d9fbcc58e4..c6eb11b9a48c 100644
--- a/cui/source/dialogs/commonlingui.hxx
+++ b/cui/source/dialogs/commonlingui.hxx
@@ -152,18 +152,6 @@ public:
// returns the location (upper-left corner) of the group of action buttons
inline Point GetActionButtonsLocation( ) const { return aIgnoreBtn.GetPosPixel(); }
-
- // updates the help texts for the "change" and "change all" buttons according to the currently
- // entered texts
- void UpdateChangesHelp( const String& _rNewText );
- inline void UpdateChangesHelp( ) { UpdateChangesHelp( GetWordInputControl().GetText() ); }
-
- // updates the help texts for the "ignore" and "always ignore" buttons according to the currently
- // entered texts
- void UpdateIgnoreHelp( );
-
- String GetNewEditWord();
- void SetNewEditWord( const String& _rNew );
};
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index a773c1a84b31..4acfe2b8eec7 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -958,7 +958,7 @@ void TPGalleryThemeProperties::FillFilterList()
}
}
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if ( aExtensions.Len() > 240 )
aExtensions = DEFINE_CONST_UNICODE( "*.*" );
#endif
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index 297b1ad921c4..94477b6ef3dc 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -136,9 +136,6 @@ SvxHpLinkDlg::SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings)
pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_NEWDOCUMENT, aStrTitle, aImage, aImageHC, SvxHyperlinkNewDocTp::Create );
pEntry->SetQuickHelpText( CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCNTP_HELP ) );
- // all tab pages set -> create mnemonics
- // CreateIconTextAutoMnemonics(); #99671# not useful, because this is not what user expects when using mnemonics on the pages
-
// create itemset for tabpages
mpItemSet = new SfxItemSet( SFX_APP()->GetPool(), SID_HYPERLINK_GETLINK,
SID_HYPERLINK_SETLINK );
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 2198a42c3fcf..32e62d3e7f80 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -690,12 +690,6 @@ namespace svx
}
//-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetOptionsHdl( const Link& _rHdl )
- {
- m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eOptions, _rHdl );
- }
-
- //-------------------------------------------------------------------------
void HangulHanjaConversionDialog::SetFindHdl( const Link& _rHdl )
{
m_aFind.SetClickHdl( _rHdl );
@@ -866,11 +860,6 @@ namespace svx
}
//-------------------------------------------------------------------------
- sal_Bool HangulHanjaConversionDialog::GetByCharacter( ) const
- {
- return m_aReplaceByChar.IsChecked();
- }
- //-------------------------------------------------------------------------
void HangulHanjaConversionDialog::SetConversionDirectionState(
sal_Bool _bTryBothDirections,
HHC::ConversionDirection _ePrimaryConversionDirection )
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index dc50bd8f205d..1015063b05e3 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -173,37 +173,6 @@ void SvxHyperlinkNewDocTp::FillDlgFields ( String& /*aStrURL*/ )
#define INTERNETSHORTCUT_URL_TAG "URL"
#define INTERNETSHORTCUT_ICONID_TAG "IconIndex"
-void SvxHyperlinkNewDocTp::ReadURLFile( const String& rFile, String& rTitle, String& rURL, sal_Int32& rIconId, BOOL* pShowAsFolder )
-{
- // Open file
- Config aCfg( rFile );
- aCfg.SetGroup( INTERNETSHORTCUT_ID_TAG );
-
- // read URL
- rURL = aCfg.ReadKey( ByteString( RTL_CONSTASCII_STRINGPARAM( INTERNETSHORTCUT_URL_TAG) ), RTL_TEXTENCODING_ASCII_US );
- SvtPathOptions aPathOpt;
- rURL = aPathOpt.SubstituteVariable( rURL );
-
- // read target
- if ( pShowAsFolder )
- {
- String aTemp( aCfg.ReadKey( ByteString( RTL_CONSTASCII_STRINGPARAM( INTERNETSHORTCUT_TARGET_TAG ) ), RTL_TEXTENCODING_ASCII_US ) );
- *pShowAsFolder = aTemp == String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( INTERNETSHORTCUT_FOLDER_TAG ) );
- }
-
- // read image-ID
- String aStrIconId( aCfg.ReadKey( ByteString( RTL_CONSTASCII_STRINGPARAM( INTERNETSHORTCUT_ICONID_TAG ) ), RTL_TEXTENCODING_ASCII_US ) );
- rIconId = aStrIconId.ToInt32();
-
- // read title
- String aLangStr = aPathOpt.SubstituteVariable( DEFINE_CONST_UNICODE("$(vlang)") );
- ByteString aLang( aLangStr, RTL_TEXTENCODING_UTF8 );
- ByteString aGroup = INTERNETSHORTCUT_ID_TAG;
- ( ( aGroup += '-' ) += aLang ) += ".W";
- aCfg.SetGroup( aGroup );
- rTitle = String( aCfg.ReadKey( INTERNETSHORTCUT_TITLE_TAG ), RTL_TEXTENCODING_UTF7 );
-}
-
void SvxHyperlinkNewDocTp::FillDocumentList ()
{
EnterWait();
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index adea20068499..a9356704e503 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -149,56 +149,6 @@ sal_Bool IconChoicePage::QueryClose()
/**********************************************************************
|
-| handling itemsets
-|
-\**********************************************************************/
-
-const SfxPoolItem* IconChoicePage::GetItem( const SfxItemSet& rSet,
- USHORT nSlot )
-{
- const SfxItemPool* pPool = rSet.GetPool();
- USHORT nWh = pPool->GetWhich( nSlot );
- const SfxPoolItem* pItem = 0;
- rSet.GetItemState( nWh, TRUE, &pItem );
-
- if ( !pItem && nWh != nSlot )
- pItem = &pPool->GetDefaultItem( nWh );
-
- return pItem;
-}
-
-// -----------------------------------------------------------------------
-
-const SfxPoolItem* IconChoicePage::GetOldItem( const SfxItemSet& rSet,
- USHORT nSlot )
-{
- const SfxItemSet& rOldSet = GetItemSet();
- USHORT nWh = GetWhich( nSlot );
- const SfxPoolItem* pItem = 0;
-
- if ( bStandard && rOldSet.GetParent() )
- pItem = GetItem( *rOldSet.GetParent(), nSlot );
- else if ( rSet.GetParent() && SFX_ITEM_DONTCARE == rSet.GetItemState( nWh ) )
- pItem = GetItem( *rSet.GetParent(), nSlot );
- else
- pItem = GetItem( rOldSet, nSlot );
-
- return pItem;
-}
-
-// -----------------------------------------------------------------------
-
-const SfxPoolItem* IconChoicePage::GetExchangeItem( const SfxItemSet& rSet,
- USHORT nSlot )
-{
- if ( pDialog && !pDialog->IsInOK() && pDialog->GetExampleSet() )
- return GetItem( *pDialog->GetExampleSet(), nSlot );
- else
- return GetOldItem( rSet, nSlot );
-}
-
-/**********************************************************************
-|
| window-methods
|
\**********************************************************************/
@@ -380,18 +330,6 @@ IconChoiceDialog ::~IconChoiceDialog ()
delete pData;
}
- // remove Pagelist
-/* for ( i=0; i<maPageList.Count(); i++ )
- {
- IconChoicePageData* pData = (IconChoicePageData*)maPageList.GetObject ( i );
-
- if ( pData->bOnDemand )
- delete ( SfxItemSet * )&( pData->pPage->GetItemSet() );
-
- delete pData->pPage;
- delete pData;
- }*/
-
// remove Userdata from Icons
for ( i=0; i<maIconCtrl.GetEntryCount(); i++)
{
@@ -415,26 +353,6 @@ IconChoiceDialog ::~IconChoiceDialog ()
SvxIconChoiceCtrlEntry* IconChoiceDialog::AddTabPage( USHORT nId, const String& rIconText,
const Image& rChoiceIcon,
- CreatePage pCreateFunc /* != 0 */,
- GetPageRanges pRangesFunc /* darf 0 sein */,
- BOOL bItemsOnDemand, ULONG /*nPos*/ )
-{
- IconChoicePageData* pData = new IconChoicePageData ( nId, pCreateFunc,
- pRangesFunc,
- bItemsOnDemand );
- maPageList.Insert ( pData, LIST_APPEND );
-
- pData->fnGetRanges = pRangesFunc;
- pData->bOnDemand = bItemsOnDemand;
-
- USHORT *pId = new USHORT ( nId );
- SvxIconChoiceCtrlEntry* pEntry = maIconCtrl.InsertEntry( rIconText, rChoiceIcon );
- pEntry->SetUserData ( (void*) pId );
- return pEntry;
-}
-
-SvxIconChoiceCtrlEntry* IconChoiceDialog::AddTabPage( USHORT nId, const String& rIconText,
- const Image& rChoiceIcon,
const Image& rChoiceIconHC,
CreatePage pCreateFunc /* != 0 */,
GetPageRanges pRangesFunc /* darf 0 sein */,
@@ -456,65 +374,6 @@ SvxIconChoiceCtrlEntry* IconChoiceDialog::AddTabPage( USHORT nId, const String&
/**********************************************************************
|
-| remove page
-|
-\**********************************************************************/
-
-void IconChoiceDialog::RemoveTabPage( USHORT nId )
-{
- IconChoicePageData* pData = GetPageData ( nId );
-
- // remove page from list
- if ( pData )
- {
- maPageList.Remove ( pData );
-
- // save settings
- if ( pData->pPage )
- {
- pData->pPage->FillUserData();
- String aPageData(pData->pPage->GetUserData());
- if ( aPageData.Len() )
- {
- SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pData->nId ) );
-
- SetViewOptUserItem( aTabPageOpt, aPageData );
- }
- }
-
- if ( pData->bOnDemand )
- delete ( SfxItemSet * )&( pData->pPage->GetItemSet() );
-
- delete pData->pPage;
- delete pData;
- }
-
- // remove Icon
- BOOL bFound=FALSE;
- for ( ULONG i=0; i<maIconCtrl.GetEntryCount() && !bFound; i++)
- {
- SvxIconChoiceCtrlEntry* pEntry = maIconCtrl.GetEntry ( i );
- USHORT* pUserData = (USHORT*) pEntry->GetUserData();
-
- if ( *pUserData == nId )
- {
- delete pUserData;
- maIconCtrl.RemoveEntry ( pEntry );
- bFound = TRUE;
- }
- }
-
- // was it the current page ?
- if ( nId == mnCurrentPageId )
- {
- mnCurrentPageId = maPageList.First()->nId;
- }
-
- Invalidate ();
-}
-
-/**********************************************************************
-|
| Paint-method
|
\**********************************************************************/
@@ -572,13 +431,6 @@ EIconChoicePos IconChoiceDialog::SetCtrlPos( const EIconChoicePos& rPos )
return eOldPos;
}
-void IconChoiceDialog::SetCtrlColor ( const Color& rColor )
-{
- Wallpaper aWallpaper ( rColor );
- maIconCtrl.SetBackground( aWallpaper );
- maIconCtrl.SetFontColorToBackground ();
-}
-
/**********************************************************************
|
| Show / Hide page or button
@@ -601,14 +453,6 @@ void IconChoiceDialog::HidePageImpl ( IconChoicePageData* pData )
// -----------------------------------------------------------------------
-void IconChoiceDialog::RemoveResetButton()
-{
- aResetBtn.Hide();
- bHideResetBtn = TRUE;
-}
-
-// -----------------------------------------------------------------------
-
void IconChoiceDialog::ShowPage( USHORT nId )
{
bool bInvalidate = GetCurPageId() != nId;
@@ -1144,40 +988,6 @@ void IconChoiceDialog::SetInputSet( const SfxItemSet* pInSet )
// -----------------------------------------------------------------------
-// Liefert die Pages, die ihre Sets onDemand liefern, das OutputItemSet.
-const SfxItemSet* IconChoiceDialog::GetOutputItemSet ( USHORT nId )
-{
- IconChoicePageData * pData = GetPageData ( nId );
- DBG_ASSERT( pData, "TabPage nicht gefunden" );
-
- if ( pData )
- {
- if ( !pData->pPage )
- return NULL;
-
- if ( pData->bOnDemand )
- return &pData->pPage->GetItemSet();
-
- return pOutSet;
- }
-
- return NULL;
-}
-
-// -----------------------------------------------------------------------
-
-int IconChoiceDialog::FillOutputItemSet()
-{
- int nRet = IconChoicePage::LEAVE_PAGE;
- if ( OK_Impl() )
- Ok();
- else
- nRet = IconChoicePage::KEEP_PAGE;
- return nRet;
-}
-
-// -----------------------------------------------------------------------
-
void IconChoiceDialog::PageCreated( USHORT /*nId*/, IconChoicePage& /*rPage*/ )
{
// not interested in
@@ -1404,13 +1214,6 @@ short IconChoiceDialog::Ok()
// -----------------------------------------------------------------------
-BOOL IconChoiceDialog::IsInOK() const
-{
- return bInOK;
-}
-
-// -----------------------------------------------------------------------
-
void IconChoiceDialog::FocusOnIcon( USHORT nId )
{
// set focus to icon for the current visible page
@@ -1426,10 +1229,3 @@ void IconChoiceDialog::FocusOnIcon( USHORT nId )
}
}
}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::CreateIconTextAutoMnemonics( void )
-{
- maIconCtrl.CreateAutoMnemonics();
-}
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index c45dfeb9dc06..8cf21129f52c 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -196,11 +196,6 @@ void SvInsertOleDlg::SelectDefault()
aLbObjecttype.SelectEntryPos( 0 );
}
-void SvInsertOleDlg::FillObjectServerList( SvObjectServerList* pList )
-{
- pList->FillInsertObjects();
-}
-
// -----------------------------------------------------------------------
SvInsertOleDlg::SvInsertOleDlg
(
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index e1763249479c..62ec77c3c26a 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -367,15 +367,6 @@ void SFTreeListBox:: RequestSubEntries( SvLBoxEntry* pRootEntry, Reference< ::co
}
}
-void SFTreeListBox::UpdateEntries()
-{
-}
-
-SvLBoxEntry* SFTreeListBox::FindEntry( SvLBoxEntry* , const String& , BYTE )
-{
- return 0;
-}
-
long SFTreeListBox::ExpandingHdl()
{
return TRUE;
@@ -626,10 +617,6 @@ short SvxScriptOrgDialog::Execute()
return nRet;
}
-void SvxScriptOrgDialog::EnableButton( Button& , BOOL )
-{
-}
-
void SvxScriptOrgDialog::CheckButtons( Reference< browse::XBrowseNode >& node )
{
if ( node.is() )
@@ -921,38 +908,6 @@ Reference< XModel > SvxScriptOrgDialog::getModel( SvLBoxEntry* pEntry )
return model;
}
-Reference< XInterface >
-SvxScriptOrgDialog::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OUString& docName )
-{
- Reference< XInterface > xModel;
- Reference< lang::XMultiComponentFactory > mcf =
- xCtx->getServiceManager();
- Reference< frame::XDesktop > desktop (
- mcf->createInstanceWithContext(
- ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx ),
- UNO_QUERY );
-
- Reference< container::XEnumerationAccess > componentsAccess =
- desktop->getComponents();
- Reference< container::XEnumeration > components =
- componentsAccess->createEnumeration();
- while (components->hasMoreElements())
- {
- Reference< frame::XModel > model(
- components->nextElement(), UNO_QUERY );
- if ( model.is() )
- {
- ::rtl::OUString sTdocUrl = ::comphelper::DocumentInfo::getDocumentTitle( model );
- if( sTdocUrl.equals( docName ) )
- {
- xModel = model;
- break;
- }
- }
- }
- return xModel;
-}
-
void SvxScriptOrgDialog::createEntry( SvLBoxEntry* pEntry )
{
@@ -1371,28 +1326,6 @@ void SvxScriptOrgDialog::RestorePreviousSelection()
aScriptsBox.SetCurEntry( pEntry );
}
-BOOL SFTreeListBox::dialogSort1( Reference< browse::XBrowseNode > node1,
- Reference< browse::XBrowseNode > node2 )
-{
- ::rtl::OUString userStr = ::rtl::OUString::createFromAscii("user");
- ::rtl::OUString shareStr = ::rtl::OUString::createFromAscii("share");
- if( node1->getName().equals( userStr ) )
- return true;
- if( node2->getName().equals( userStr ) )
- return false;
- if( node1->getName().equals( shareStr ) )
- return true;
- if( node2->getName().equals( shareStr ) )
- return false;
- return dialogSort2( node1, node2 );
-}
-
-BOOL SFTreeListBox::dialogSort2( Reference< browse::XBrowseNode > node1,
- Reference< browse::XBrowseNode > node2 )
-{
- return ( node1->getName().compareTo( node2->getName() ) < 0 );
-}
-
::rtl::OUString ReplaceString(
const ::rtl::OUString& source,
const ::rtl::OUString& token,
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index bf617b126747..c1811b196895 100644..100755
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -57,6 +57,7 @@
#include <i18npool/mslangid.hxx>
#include <comphelper/processfactory.hxx>
#include <osl/file.hxx>
+#include <svl/lngmisc.hxx>
#include <stack>
@@ -73,36 +74,6 @@ using ::rtl::OUString;
#define A2S(x) String::CreateFromAscii( x )
-
-// GetReplaceEditString -------------------------------
-
-static void GetReplaceEditString( String &rText )
-{
- // The strings returned by the thesaurus saometimes have some
- // explanation text put in between '(' and ')' or a trailing '*'.
- // These parts should not be put in the ReplaceEdit Text that may get
- // inserted into the document. Thus we strip them from the text.
-
- xub_StrLen nPos = rText.Search( sal_Unicode('(') );
- while (STRING_NOTFOUND != nPos)
- {
- xub_StrLen nEnd = rText.Search( sal_Unicode(')'), nPos );
- if (STRING_NOTFOUND != nEnd)
- rText.Erase( nPos, nEnd-nPos+1 );
- else
- break;
- nPos = rText.Search( sal_Unicode('(') );
- }
-
- nPos = rText.Search( sal_Unicode('*') );
- if (STRING_NOTFOUND != nPos)
- rText.Erase( nPos );
-
- // remove any possible remaining ' ' that may confuse the thesaurus
- // when it gets called with the text
- rText.EraseLeadingAndTrailingChars( sal_Unicode(' ') );
-}
-
// class LookUpComboBox_Impl --------------------------------------------------
LookUpComboBox_Impl::LookUpComboBox_Impl(
@@ -172,12 +143,21 @@ void ReplaceEdit_Impl::SetText( const XubString& rStr, const Selection& rNewSele
// class ThesaurusAlternativesCtrl_Impl ----------------------------------
+AlternativesString_Impl::AlternativesString_Impl(
+ ThesaurusAlternativesCtrl_Impl &rControl,
+ SvLBoxEntry* pEntry, USHORT nFlags, const String& rStr ) :
+ //
+ SvLBoxString( pEntry, nFlags, rStr ),
+ m_rControlImpl( rControl )
+{
+}
+
void AlternativesString_Impl::Paint(
const Point& rPos,
SvLBox& rDev, USHORT,
SvLBoxEntry* pEntry )
{
- AlternativesUserData_Impl* pData = (AlternativesUserData_Impl*)pEntry->GetUserData();
+ AlternativesExtraData* pData = m_rControlImpl.GetExtraData( pEntry );
Point aPos( rPos );
Font aOldFont( rDev.GetFont());
if (pData && pData->IsHeader())
@@ -207,14 +187,40 @@ ThesaurusAlternativesCtrl_Impl::ThesaurusAlternativesCtrl_Impl(
ThesaurusAlternativesCtrl_Impl::~ThesaurusAlternativesCtrl_Impl()
{
- ClearUserData();
+ ClearExtraData();
+}
+
+
+void ThesaurusAlternativesCtrl_Impl::ClearExtraData()
+{
+ UserDataMap_t aEmpty;
+ m_aUserData.swap( aEmpty );
+}
+
+
+void ThesaurusAlternativesCtrl_Impl::SetExtraData(
+ const SvLBoxEntry *pEntry,
+ const AlternativesExtraData &rData )
+{
+ if (!pEntry)
+ return;
+
+ UserDataMap_t::iterator aIt( m_aUserData.find( pEntry ) );
+ if (aIt != m_aUserData.end())
+ aIt->second = rData;
+ else
+ m_aUserData[ pEntry ] = rData;
}
-void ThesaurusAlternativesCtrl_Impl::ClearUserData()
+AlternativesExtraData * ThesaurusAlternativesCtrl_Impl::GetExtraData(
+ const SvLBoxEntry *pEntry )
{
- for (USHORT i = 0; i < GetEntryCount(); ++i)
- delete (AlternativesUserData_Impl*)GetEntry(i)->GetUserData();
+ AlternativesExtraData *pRes = NULL;
+ UserDataMap_t::iterator aIt( m_aUserData.find( pEntry ) );
+ if (aIt != m_aUserData.end())
+ pRes = &aIt->second;
+ return pRes;
}
@@ -230,10 +236,9 @@ SvLBoxEntry * ThesaurusAlternativesCtrl_Impl::AddEntry( sal_Int32 nVal, const St
pEntry->AddItem( new SvLBoxString( pEntry, 0, String() ) ); // add empty column
aText += rText;
pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0 ) ); // otherwise crash
- pEntry->AddItem( new AlternativesString_Impl( pEntry, 0, aText ) );
+ pEntry->AddItem( new AlternativesString_Impl( *this, pEntry, 0, aText ) );
- AlternativesUserData_Impl* pUserData = new AlternativesUserData_Impl( rText, bIsHeader );
- pEntry->SetUserData( pUserData );
+ SetExtraData( pEntry, AlternativesExtraData( rText, bIsHeader ) );
GetModel()->Insert( pEntry );
if (bIsHeader)
@@ -365,7 +370,7 @@ bool SvxThesaurusDialog_Impl::UpdateAlternativesBox_Impl()
m_pAlternativesCT->SetUpdateMode( FALSE );
// clear old user data of control before creating new ones via AddEntry below
- m_pAlternativesCT->ClearUserData();
+ m_pAlternativesCT->ClearExtraData();
m_pAlternativesCT->Clear();
for (sal_Int32 i = 0; i < nMeanings; ++i)
@@ -454,7 +459,7 @@ IMPL_LINK( SvxThesaurusDialog_Impl, WordSelectHdl_Impl, ComboBox *, pBox )
{
USHORT nPos = pBox->GetSelectEntryPos();
String aStr( pBox->GetEntry( nPos ) );
- GetReplaceEditString( aStr );
+ aStr = linguistic::GetThesaurusReplaceText( aStr );
aWordCB.SetText( aStr );
LookUp_Impl();
}
@@ -468,12 +473,12 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesSelectHdl_Impl, SvxCheckListBox
SvLBoxEntry *pEntry = pBox ? pBox->GetCurEntry() : NULL;
if (pEntry)
{
- AlternativesUserData_Impl * pData = (AlternativesUserData_Impl *) pEntry->GetUserData();
+ AlternativesExtraData * pData = m_pAlternativesCT->GetExtraData( pEntry );
String aStr;
- if (!pData->IsHeader())
+ if (pData && !pData->IsHeader())
{
aStr = pData->GetText();
- GetReplaceEditString( aStr );
+ aStr = linguistic::GetThesaurusReplaceText( aStr );
}
aReplaceEdit.SetText( aStr );
}
@@ -486,12 +491,12 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckLis
SvLBoxEntry *pEntry = pBox ? pBox->GetCurEntry() : NULL;
if (pEntry)
{
- AlternativesUserData_Impl * pData = (AlternativesUserData_Impl *) pEntry->GetUserData();
+ AlternativesExtraData * pData = m_pAlternativesCT->GetExtraData( pEntry );
String aStr;
- if (!pData->IsHeader())
+ if (pData && !pData->IsHeader())
{
aStr = pData->GetText();
- GetReplaceEditString( aStr );
+ aStr = linguistic::GetThesaurusReplaceText( aStr );
}
aWordCB.SetText( aStr );
@@ -509,8 +514,8 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckLis
IMPL_STATIC_LINK( SvxThesaurusDialog_Impl, SelectFirstHdl_Impl, SvxCheckListBox *, pBox )
{
(void) pThis;
- if (pBox && pBox->GetEntryCount() > 0)
- pBox->SelectEntryPos( 0 );
+ if (pBox && pBox->GetEntryCount() >= 2)
+ pBox->SelectEntryPos( 1 ); // pos 0 is a 'header' that is not selectable
return 0;
}
diff --git a/cui/source/dialogs/thesdlg.src b/cui/source/dialogs/thesdlg.src
index cf5eac8e5a02..1aff40881000 100644..100755
--- a/cui/source/dialogs/thesdlg.src
+++ b/cui/source/dialogs/thesdlg.src
@@ -59,7 +59,7 @@ ModalDialog RID_SVXDLG_THESAURUS
{
Pos = MAP_APPFONT ( 24 , 5 ) ;
Size = MAP_APPFONT ( 143 , 8 ) ;
- Text [ en-US ] = "Current ~word" ;
+ Text [ en-US ] = "~Current word" ;
LEFT = TRUE ;
};
ComboBox CB_WORD
@@ -95,7 +95,7 @@ ModalDialog RID_SVXDLG_THESAURUS
{
Pos = MAP_APPFONT ( 5 , 173 ) ;
Size = MAP_APPFONT ( 255 , 8 ) ;
- Text [ en-US ] = "Replace ~with" ;
+ Text [ en-US ] = "~Replace with" ;
LEFT = TRUE ;
};
Edit ED_REPL
@@ -120,7 +120,7 @@ ModalDialog RID_SVXDLG_THESAURUS
{
Pos = MAP_APPFONT ( 105 , 210 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "~Replace" ;
+ Text [ en-US ] = "Replace" ;
DefButton = TRUE ;
};
CancelButton BTN_THES_CANCEL
diff --git a/cui/source/dialogs/thesdlg_impl.hxx b/cui/source/dialogs/thesdlg_impl.hxx
index 70ce91391456..b682c8d0c129 100644..100755
--- a/cui/source/dialogs/thesdlg_impl.hxx
+++ b/cui/source/dialogs/thesdlg_impl.hxx
@@ -51,11 +51,16 @@
#include <com/sun/star/linguistic2/XMeaning.hpp>
#include <stack>
+#include <map>
#include <algorithm>
using namespace ::com::sun::star;
using ::rtl::OUString;
+class SvLBoxEntry;
+class ThesaurusAlternativesCtrl_Impl;
+
+
// class LookUpComboBox_Impl --------------------------------------------------
class LookUpComboBox_Impl : public ComboBox
@@ -105,17 +110,14 @@ public:
// class ThesaurusAlternativesCtrl_Impl ----------------------------------
-class AlternativesUserData_Impl
+class AlternativesExtraData
{
String sText;
bool bHeader;
- // disable copy c-tor and assignment operator
- AlternativesUserData_Impl( const AlternativesUserData_Impl & );
- AlternativesUserData_Impl & operator = ( const AlternativesUserData_Impl & );
-
public:
- AlternativesUserData_Impl( const String &rText, bool bIsHeader ) :
+ AlternativesExtraData() : bHeader( false ) {}
+ AlternativesExtraData( const String &rText, bool bIsHeader ) :
sText(rText),
bHeader(bIsHeader)
{
@@ -128,10 +130,11 @@ public:
class AlternativesString_Impl : public SvLBoxString
{
+ ThesaurusAlternativesCtrl_Impl & m_rControlImpl;
public:
- AlternativesString_Impl( SvLBoxEntry* pEntry, USHORT nFlags, const String& rStr )
- : SvLBoxString( pEntry, nFlags, rStr ) {}
+ AlternativesString_Impl( ThesaurusAlternativesCtrl_Impl &rControl,
+ SvLBoxEntry* pEntry, USHORT nFlags, const String& rStr );
virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, SvLBoxEntry* pEntry);
};
@@ -142,6 +145,9 @@ class ThesaurusAlternativesCtrl_Impl :
{
SvxThesaurusDialog_Impl & m_rDialogImpl;
+ typedef std::map< const SvLBoxEntry *, AlternativesExtraData > UserDataMap_t;
+ UserDataMap_t m_aUserData;
+
// disable copy c-tor and assignment operator
ThesaurusAlternativesCtrl_Impl( const ThesaurusAlternativesCtrl_Impl & );
ThesaurusAlternativesCtrl_Impl & operator = ( const ThesaurusAlternativesCtrl_Impl & );
@@ -152,7 +158,10 @@ public:
SvLBoxEntry * AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader );
- void ClearUserData();
+
+ void ClearExtraData();
+ void SetExtraData( const SvLBoxEntry *pEntry, const AlternativesExtraData &rData );
+ AlternativesExtraData * GetExtraData( const SvLBoxEntry *pEntry );
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void Paint( const Rectangle& rRect );
diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index bfb3320d7ac6..e838e94c0db6 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -58,13 +58,6 @@
// static ----------------------------------------------------------------
-static USHORT pRanges[] =
-{
- SID_ATTR_ZOOM,
- SID_ATTR_ZOOM,
- 0
-};
-
#define SPECIAL_FACTOR ((USHORT)0xFFFF)
// class SvxZoomDialog ---------------------------------------------------
@@ -124,29 +117,6 @@ void SvxZoomDialog::SetFactor( USHORT nNewFactor, USHORT nBtnId )
// -----------------------------------------------------------------------
-void SvxZoomDialog::SetButtonText( USHORT nBtnId, const String& rNewTxt )
-{
- switch ( nBtnId )
- {
- case ZOOMBTN_OPTIMAL: // Optimal-Button
- aOptimalBtn.SetText( rNewTxt );
- break;
-
- case ZOOMBTN_PAGEWIDTH: // Seitenbreite-Button
- aPageWidthBtn.SetText( rNewTxt );
- break;
-
- case ZOOMBTN_WHOLEPAGE: // Ganze Seite-Button
- aWholePageBtn.SetText( rNewTxt );
- break;
-
- default:
- DBG_ERROR( "wrong button number" );
- }
-}
-
-// -----------------------------------------------------------------------
-
void SvxZoomDialog::HideButton( USHORT nBtnId )
{
switch ( nBtnId )
@@ -181,13 +151,6 @@ void SvxZoomDialog::SetLimits( USHORT nMin, USHORT nMax )
// -----------------------------------------------------------------------
-void SvxZoomDialog::SetSpinSize( USHORT nNewSpin )
-{
- aUserEdit.SetSpinSize( nNewSpin );
-}
-
-// -----------------------------------------------------------------------
-
SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
SfxModalDialog( pParent, CUI_RES( RID_SVXDLG_ZOOM ) ),
@@ -370,13 +333,6 @@ SvxZoomDialog::~SvxZoomDialog()
// -----------------------------------------------------------------------
-USHORT* SvxZoomDialog::GetRanges()
-{
- return pRanges;
-}
-
-// -----------------------------------------------------------------------
-
IMPL_LINK( SvxZoomDialog, UserHdl, RadioButton *, pBtn )
{
bModified |= TRUE;