2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 17:02:47 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2007-01-02 14:51:44 +00:00
|
|
|
|
|
|
|
#include "basidesh.hxx"
|
|
|
|
#include "basobj.hxx"
|
2011-11-06 22:13:59 -05:00
|
|
|
#include "iderdll.hxx"
|
|
|
|
#include "iderid.hxx"
|
|
|
|
#include "localizationmgr.hxx"
|
|
|
|
#include "managelang.hxx"
|
2007-01-02 14:51:44 +00:00
|
|
|
|
2011-11-30 22:03:58 -05:00
|
|
|
#include "dlgresid.hrc"
|
2007-01-02 14:51:44 +00:00
|
|
|
#include "helpid.hrc"
|
|
|
|
|
2012-02-15 15:26:43 +01:00
|
|
|
#include <com/sun/star/i18n/Boundary.hpp>
|
2007-01-29 16:01:16 +00:00
|
|
|
#include <com/sun/star/i18n/WordType.hpp>
|
2012-02-15 15:26:43 +01:00
|
|
|
#include <com/sun/star/i18n/XBreakIterator.hpp>
|
2011-11-06 22:13:59 -05:00
|
|
|
#include <editeng/unolingu.hxx>
|
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
#include <svtools/langtab.hxx>
|
2011-11-30 22:03:58 -05:00
|
|
|
#include <svx/langbox.hxx>
|
2007-01-29 16:01:16 +00:00
|
|
|
#include <vcl/unohelp.hxx>
|
2007-01-02 14:51:44 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
2014-08-25 13:19:06 +01:00
|
|
|
#include <vcl/layout.hxx>
|
2014-01-02 23:52:37 +01:00
|
|
|
#include <vcl/settings.hxx>
|
2007-01-02 14:51:44 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
namespace basctl
|
|
|
|
{
|
|
|
|
|
2007-01-29 16:01:16 +00:00
|
|
|
using namespace ::com::sun::star::i18n;
|
2007-01-02 14:51:44 +00:00
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::resource;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
|
|
|
|
bool localesAreEqual( const Locale& rLocaleLeft, const Locale& rLocaleRight )
|
|
|
|
{
|
|
|
|
bool bRet = ( rLocaleLeft.Language.equals( rLocaleRight.Language ) &&
|
|
|
|
rLocaleLeft.Country.equals( rLocaleRight.Country ) &&
|
|
|
|
rLocaleLeft.Variant.equals( rLocaleRight.Variant ) );
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
ManageLanguageDialog::ManageLanguageDialog(vcl::Window* pParent, boost::shared_ptr<LocalizationMgr> xLMgr)
|
2014-02-11 10:31:42 +00:00
|
|
|
: ModalDialog(pParent, "ManageLanguagesDialog", "modules/BasicIDE/ui/managelanguages.ui")
|
|
|
|
, m_xLocalizationMgr(xLMgr)
|
|
|
|
, m_sDefLangStr(IDE_RESSTR(RID_STR_DEF_LANG))
|
|
|
|
, m_sCreateLangStr(IDE_RESSTR(RID_STR_CREATE_LANG))
|
2007-01-02 14:51:44 +00:00
|
|
|
{
|
2014-02-11 10:31:42 +00:00
|
|
|
get(m_pLanguageLB, "treeview");
|
|
|
|
m_pLanguageLB->set_height_request(m_pLanguageLB->GetTextHeight() * 10);
|
|
|
|
m_pLanguageLB->set_width_request(m_pLanguageLB->approximate_char_width() * 50);
|
|
|
|
get(m_pAddPB, "add");
|
|
|
|
get(m_pDeletePB, "delete");
|
|
|
|
get(m_pMakeDefPB, "default");
|
2007-01-02 14:51:44 +00:00
|
|
|
|
|
|
|
Init();
|
|
|
|
FillLanguageBox();
|
|
|
|
SelectHdl( NULL );
|
|
|
|
}
|
|
|
|
|
|
|
|
ManageLanguageDialog::~ManageLanguageDialog()
|
|
|
|
{
|
|
|
|
ClearLanguageBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ManageLanguageDialog::Init()
|
|
|
|
{
|
|
|
|
// get current IDE
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
Shell* pShell = GetShell();
|
2012-10-22 22:11:23 -02:00
|
|
|
OUString sLibName = pShell->GetCurLibName();
|
2007-01-02 14:51:44 +00:00
|
|
|
// set dialog title with library name
|
2012-10-22 22:11:23 -02:00
|
|
|
OUString sText = GetText();
|
2012-03-08 00:49:32 +01:00
|
|
|
sText = sText.replaceAll("$1", sLibName);
|
2007-01-02 14:51:44 +00:00
|
|
|
SetText( sText );
|
|
|
|
// set handler
|
2014-02-11 10:31:42 +00:00
|
|
|
m_pAddPB->SetClickHdl( LINK( this, ManageLanguageDialog, AddHdl ) );
|
|
|
|
m_pDeletePB->SetClickHdl( LINK( this, ManageLanguageDialog, DeleteHdl ) );
|
|
|
|
m_pMakeDefPB->SetClickHdl( LINK( this, ManageLanguageDialog, MakeDefHdl ) );
|
|
|
|
m_pLanguageLB->SetSelectHdl( LINK( this, ManageLanguageDialog, SelectHdl ) );
|
2007-01-02 14:51:44 +00:00
|
|
|
|
2014-02-11 10:31:42 +00:00
|
|
|
m_pLanguageLB->EnableMultiSelection( true );
|
2007-01-02 14:51:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ManageLanguageDialog::FillLanguageBox()
|
|
|
|
{
|
2014-01-03 20:53:11 +00:00
|
|
|
DBG_ASSERT( m_xLocalizationMgr, "ManageLanguageDialog::FillLanguageBox(): no localization manager" );
|
2007-01-02 14:51:44 +00:00
|
|
|
|
2014-01-03 20:53:11 +00:00
|
|
|
if ( m_xLocalizationMgr->isLibraryLocalized() )
|
2007-01-02 14:51:44 +00:00
|
|
|
{
|
2014-01-03 20:53:11 +00:00
|
|
|
Locale aDefaultLocale = m_xLocalizationMgr->getStringResourceManager()->getDefaultLocale();
|
|
|
|
Sequence< Locale > aLocaleSeq = m_xLocalizationMgr->getStringResourceManager()->getLocales();
|
2007-01-02 14:51:44 +00:00
|
|
|
const Locale* pLocale = aLocaleSeq.getConstArray();
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Int32 i, nCount = aLocaleSeq.getLength();
|
2007-01-02 14:51:44 +00:00
|
|
|
for ( i = 0; i < nCount; ++i )
|
|
|
|
{
|
|
|
|
bool bIsDefault = localesAreEqual( aDefaultLocale, pLocale[i] );
|
2013-07-13 02:54:05 +02:00
|
|
|
LanguageType eLangType = LanguageTag::convertToLanguageType( pLocale[i] );
|
2014-04-17 22:58:40 +02:00
|
|
|
OUString sLanguage = SvtLanguageTable::GetLanguageString( eLangType );
|
2007-01-02 14:51:44 +00:00
|
|
|
if ( bIsDefault )
|
|
|
|
{
|
2013-08-17 21:46:26 +02:00
|
|
|
sLanguage += " " + m_sDefLangStr;
|
2007-01-02 14:51:44 +00:00
|
|
|
}
|
2014-02-11 10:31:42 +00:00
|
|
|
sal_uInt16 nPos = m_pLanguageLB->InsertEntry( sLanguage );
|
|
|
|
m_pLanguageLB->SetEntryData( nPos, new LanguageEntry( sLanguage, pLocale[i], bIsDefault ) );
|
2007-01-02 14:51:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2014-02-11 10:31:42 +00:00
|
|
|
m_pLanguageLB->InsertEntry( m_sCreateLangStr );
|
2007-01-02 14:51:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ManageLanguageDialog::ClearLanguageBox()
|
|
|
|
{
|
2014-02-11 10:31:42 +00:00
|
|
|
sal_uInt16 i, nCount = m_pLanguageLB->GetEntryCount();
|
2007-01-02 14:51:44 +00:00
|
|
|
for ( i = 0; i < nCount; ++i )
|
|
|
|
{
|
2015-03-28 18:57:52 +01:00
|
|
|
LanguageEntry* pEntry = static_cast<LanguageEntry*>(m_pLanguageLB->GetEntryData(i));
|
2012-01-26 01:02:30 +09:00
|
|
|
delete pEntry;
|
2007-01-02 14:51:44 +00:00
|
|
|
}
|
2014-02-11 10:31:42 +00:00
|
|
|
m_pLanguageLB->Clear();
|
2007-01-02 14:51:44 +00:00
|
|
|
}
|
|
|
|
|
2012-03-01 18:00:32 +01:00
|
|
|
IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl)
|
2007-01-02 14:51:44 +00:00
|
|
|
{
|
2014-01-03 20:53:11 +00:00
|
|
|
SetDefaultLanguageDialog aDlg( this, m_xLocalizationMgr );
|
2007-01-02 14:51:44 +00:00
|
|
|
if ( RET_OK == aDlg.Execute() )
|
|
|
|
{
|
|
|
|
// add new locales
|
|
|
|
Sequence< Locale > aLocaleSeq = aDlg.GetLocales();
|
2014-01-03 20:53:11 +00:00
|
|
|
m_xLocalizationMgr->handleAddLocales( aLocaleSeq );
|
2007-01-02 14:51:44 +00:00
|
|
|
// update listbox
|
|
|
|
ClearLanguageBox();
|
|
|
|
FillLanguageBox();
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2007-01-02 14:51:44 +00:00
|
|
|
pBindings->Invalidate( SID_BASICIDE_CURRENT_LANG );
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-03-01 18:00:32 +01:00
|
|
|
IMPL_LINK_NOARG(ManageLanguageDialog, DeleteHdl)
|
2007-01-02 14:51:44 +00:00
|
|
|
{
|
2014-08-25 13:19:06 +01:00
|
|
|
MessageDialog aQBox(this, "DeleteLangDialog", "modules/BasicIDE/ui/deletelang.ui");
|
2007-01-02 14:51:44 +00:00
|
|
|
if ( aQBox.Execute() == RET_OK )
|
|
|
|
{
|
2014-02-11 10:31:42 +00:00
|
|
|
sal_uInt16 i, nCount = m_pLanguageLB->GetSelectEntryCount();
|
|
|
|
sal_uInt16 nPos = m_pLanguageLB->GetSelectEntryPos();
|
2007-01-02 14:51:44 +00:00
|
|
|
// remove locales
|
|
|
|
Sequence< Locale > aLocaleSeq( nCount );
|
|
|
|
for ( i = 0; i < nCount; ++i )
|
|
|
|
{
|
2014-02-11 10:31:42 +00:00
|
|
|
sal_uInt16 nSelPos = m_pLanguageLB->GetSelectEntryPos(i);
|
2015-03-28 18:57:52 +01:00
|
|
|
LanguageEntry* pEntry = static_cast<LanguageEntry*>(m_pLanguageLB->GetEntryData( nSelPos ));
|
2007-01-02 14:51:44 +00:00
|
|
|
if ( pEntry )
|
|
|
|
aLocaleSeq[i] = pEntry->m_aLocale;
|
|
|
|
}
|
2014-01-03 20:53:11 +00:00
|
|
|
m_xLocalizationMgr->handleRemoveLocales( aLocaleSeq );
|
2007-01-02 14:51:44 +00:00
|
|
|
// update listbox
|
|
|
|
ClearLanguageBox();
|
|
|
|
FillLanguageBox();
|
|
|
|
// reset selection
|
2014-02-11 10:31:42 +00:00
|
|
|
nCount = m_pLanguageLB->GetEntryCount();
|
2007-01-02 14:51:44 +00:00
|
|
|
if ( nCount <= nPos )
|
|
|
|
nPos = nCount - 1;
|
2014-02-11 10:31:42 +00:00
|
|
|
m_pLanguageLB->SelectEntryPos( nPos );
|
2007-01-02 14:51:44 +00:00
|
|
|
SelectHdl( NULL );
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-03-01 18:00:32 +01:00
|
|
|
IMPL_LINK_NOARG(ManageLanguageDialog, MakeDefHdl)
|
2007-01-02 14:51:44 +00:00
|
|
|
{
|
2014-02-11 10:31:42 +00:00
|
|
|
sal_uInt16 nPos = m_pLanguageLB->GetSelectEntryPos();
|
2015-03-28 18:57:52 +01:00
|
|
|
LanguageEntry* pSelectEntry = static_cast<LanguageEntry*>(m_pLanguageLB->GetEntryData( nPos ));
|
2007-01-02 14:51:44 +00:00
|
|
|
if ( pSelectEntry && !pSelectEntry->m_bIsDefault )
|
|
|
|
{
|
|
|
|
// set new default entry
|
2014-01-03 20:53:11 +00:00
|
|
|
m_xLocalizationMgr->handleSetDefaultLocale( pSelectEntry->m_aLocale );
|
2007-01-02 14:51:44 +00:00
|
|
|
// update Listbox
|
|
|
|
ClearLanguageBox();
|
|
|
|
FillLanguageBox();
|
|
|
|
// reset selection
|
2014-02-11 10:31:42 +00:00
|
|
|
m_pLanguageLB->SelectEntryPos( nPos );
|
2007-01-02 14:51:44 +00:00
|
|
|
SelectHdl( NULL );
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-03-01 18:00:32 +01:00
|
|
|
IMPL_LINK_NOARG(ManageLanguageDialog, SelectHdl)
|
2007-01-02 14:51:44 +00:00
|
|
|
{
|
2014-02-11 10:31:42 +00:00
|
|
|
sal_uInt16 nCount = m_pLanguageLB->GetEntryCount();
|
2007-01-02 14:51:44 +00:00
|
|
|
bool bEmpty = ( !nCount ||
|
2014-02-11 10:31:42 +00:00
|
|
|
m_pLanguageLB->GetEntryPos( m_sCreateLangStr ) != LISTBOX_ENTRY_NOTFOUND );
|
|
|
|
bool bSelect = ( m_pLanguageLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND );
|
2014-05-09 20:59:53 +02:00
|
|
|
bool bEnable = !bEmpty && bSelect;
|
2007-01-02 14:51:44 +00:00
|
|
|
|
2014-05-09 20:59:53 +02:00
|
|
|
m_pDeletePB->Enable(bEnable);
|
|
|
|
m_pMakeDefPB->Enable(bEnable && nCount > 1 && m_pLanguageLB->GetSelectEntryCount() == 1);
|
2007-01-02 14:51:44 +00:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// class SetDefaultLanguageDialog -----------------------------------------------
|
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
SetDefaultLanguageDialog::SetDefaultLanguageDialog(vcl::Window* pParent, boost::shared_ptr<LocalizationMgr> xLMgr)
|
2014-01-03 20:53:11 +00:00
|
|
|
: ModalDialog(pParent, "DefaultLanguageDialog", "modules/BasicIDE/ui/defaultlanguage.ui")
|
|
|
|
, m_pCheckLangLB(NULL)
|
|
|
|
, m_xLocalizationMgr(xLMgr)
|
2007-01-02 14:51:44 +00:00
|
|
|
{
|
2014-01-03 20:53:11 +00:00
|
|
|
get(m_pLanguageLB, "entries");
|
|
|
|
get(m_pCheckLangLB, "checkedentries");
|
|
|
|
get(m_pDefinedFT, "defined");
|
|
|
|
get(m_pAddedFT, "added");
|
|
|
|
get(m_pLanguageFT, "defaultlabel");
|
|
|
|
get(m_pCheckLangFT, "checkedlabel");
|
|
|
|
|
|
|
|
m_pLanguageLB->set_height_request(m_pLanguageLB->GetTextHeight() * 10);
|
|
|
|
m_pCheckLangLB->set_height_request(m_pCheckLangLB->GetTextHeight() * 10);
|
|
|
|
|
|
|
|
if (m_xLocalizationMgr->isLibraryLocalized())
|
2007-01-02 14:51:44 +00:00
|
|
|
{
|
|
|
|
// change to "Add Interface Language" mode
|
2014-01-03 20:53:11 +00:00
|
|
|
m_pLanguageLB->Hide();
|
|
|
|
m_pCheckLangLB->Show();
|
|
|
|
SetText(get<FixedText>("alttitle")->GetText());
|
|
|
|
m_pLanguageFT->Hide();
|
|
|
|
m_pCheckLangFT->Show();
|
|
|
|
m_pDefinedFT->Hide();
|
|
|
|
m_pAddedFT->Show();
|
2007-01-02 14:51:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
FillLanguageBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetDefaultLanguageDialog::FillLanguageBox()
|
|
|
|
{
|
|
|
|
// fill list with all languages
|
2012-08-07 08:36:40 +02:00
|
|
|
m_pLanguageLB->SetLanguageList( LANG_LIST_ALL, false );
|
2007-01-02 14:51:44 +00:00
|
|
|
// remove the already localized languages
|
2014-01-03 20:53:11 +00:00
|
|
|
Sequence< Locale > aLocaleSeq = m_xLocalizationMgr->getStringResourceManager()->getLocales();
|
2007-01-02 14:51:44 +00:00
|
|
|
const Locale* pLocale = aLocaleSeq.getConstArray();
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Int32 i, nCount = aLocaleSeq.getLength();
|
2007-01-02 14:51:44 +00:00
|
|
|
for ( i = 0; i < nCount; ++i )
|
2013-07-13 02:54:05 +02:00
|
|
|
m_pLanguageLB->RemoveLanguage( LanguageTag::convertToLanguageType( pLocale[i] ) );
|
2007-01-02 14:51:44 +00:00
|
|
|
|
|
|
|
// fill checklistbox if not in default mode
|
2014-01-03 20:53:11 +00:00
|
|
|
if ( m_xLocalizationMgr->isLibraryLocalized() )
|
2007-01-02 14:51:44 +00:00
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 j, nCount_ = m_pLanguageLB->GetEntryCount();
|
2007-01-16 15:36:20 +00:00
|
|
|
for ( j = 0; j < nCount_; ++j )
|
2007-01-29 16:01:16 +00:00
|
|
|
{
|
|
|
|
m_pCheckLangLB->InsertEntry(
|
|
|
|
m_pLanguageLB->GetEntry(j), LISTBOX_APPEND, m_pLanguageLB->GetEntryData(j) );
|
|
|
|
}
|
|
|
|
m_pLanguageLB = NULL;
|
2007-01-02 14:51:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
// preselect current UI language
|
2012-11-22 12:26:52 +01:00
|
|
|
m_pLanguageLB->SelectLanguage( Application::GetSettings().GetUILanguageTag().getLanguageType() );
|
2007-01-29 16:01:16 +00:00
|
|
|
}
|
|
|
|
|
2007-01-02 14:51:44 +00:00
|
|
|
Sequence< Locale > SetDefaultLanguageDialog::GetLocales() const
|
|
|
|
{
|
2014-01-03 20:53:11 +00:00
|
|
|
bool bNotLocalized = !m_xLocalizationMgr->isLibraryLocalized();
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Int32 nSize = bNotLocalized ? 1 : m_pCheckLangLB->GetCheckedEntryCount();
|
2007-01-02 14:51:44 +00:00
|
|
|
Sequence< Locale > aLocaleSeq( nSize );
|
|
|
|
if ( bNotLocalized )
|
|
|
|
{
|
2012-11-24 18:54:09 +01:00
|
|
|
aLocaleSeq[0] = LanguageTag( m_pLanguageLB->GetSelectLanguage() ).getLocale();
|
2007-01-02 14:51:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 i, nCount = static_cast< sal_uInt16 >( m_pCheckLangLB->GetEntryCount() );
|
|
|
|
sal_Int32 j = 0;
|
2007-01-02 14:51:44 +00:00
|
|
|
for ( i = 0; i < nCount; ++i )
|
|
|
|
{
|
2007-01-29 16:01:16 +00:00
|
|
|
if ( m_pCheckLangLB->IsChecked(i) )
|
2007-01-02 14:51:44 +00:00
|
|
|
{
|
2014-10-21 09:12:47 +02:00
|
|
|
LanguageType eType = LanguageType( reinterpret_cast<sal_uLong>(m_pCheckLangLB->GetEntryData(i)) );
|
2013-07-13 02:54:05 +02:00
|
|
|
aLocaleSeq[j++] = LanguageTag::convertToLocale( eType );
|
2007-01-02 14:51:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
DBG_ASSERT( nSize == j, "SetDefaultLanguageDialog::GetLocales(): invalid indexes" );
|
|
|
|
}
|
|
|
|
return aLocaleSeq;
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
} // namespace basctl
|
|
|
|
|
2010-10-12 15:57:08 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|