[Libreoffice-commits] .: 5 commits - cui/source cui/uiconfig cui/UI_cui.mk cui/util editeng/source postprocess/packconfig postprocess/prj scp2/source solenv/gbuild vcl/inc vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 8 05:27:19 PST 2012
cui/UI_cui.mk | 1
cui/source/customize/acccfg.hrc | 7
cui/source/customize/acccfg.src | 32 ----
cui/source/customize/cfgutil.cxx | 20 +-
cui/source/dialogs/scriptdlg.cxx | 242 ++++++++++++++++---------------
cui/source/dialogs/scriptdlg.hrc | 29 ---
cui/source/dialogs/scriptdlg.src | 110 --------------
cui/source/inc/helpid.hrc | 2
cui/source/inc/scriptdlg.hxx | 23 +-
cui/uiconfig/ui/scriptorganizer.ui | 199 +++++++++++++++++++++++++
cui/util/hidother.src | 1
editeng/source/misc/svxacorr.cxx | 6
postprocess/packconfig/makefile.mk | 2
postprocess/packconfig/packconfig.pl | 137 ++++++++++++-----
postprocess/prj/d.lst | 2
scp2/source/ooo/file_ooo.scp | 10 +
scp2/source/ooo/module_lang_template.scp | 3
solenv/gbuild/UI.mk | 2
vcl/inc/vcl/builder.hxx | 21 ++
vcl/source/window/builder.cxx | 105 ++++++++-----
20 files changed, 548 insertions(+), 406 deletions(-)
New commits:
commit 49db8203a3c6894e4a8be85df4e030394ace9b81
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Nov 8 12:57:25 2012 +0000
sort secondary group after primary for vertical containers
and continue to sort secondary before primary for horizontal containers
Change-Id: I5ecc08fe796845b7ed115a077ace4750c50bf1c0
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index 27e6db9..796f33f 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -28,16 +28,28 @@ public:
typedef std::map<OString, OString> stringmap;
typedef Window* (*customMakeWidget)(Window *pParent, stringmap &rVec);
private:
+
+ struct PackingData
+ {
+ bool m_bVerticalOrient;
+ sal_Int32 m_nPosition;
+ PackingData(bool bVerticalOrient = false, sal_Int32 nPosition = -1)
+ : m_bVerticalOrient(bVerticalOrient)
+ , m_nPosition(nPosition)
+ {
+ }
+ };
+
struct WinAndId
{
OString m_sID;
Window *m_pWindow;
- sal_Int32 m_nPosition;
+ PackingData m_aPackingData;
bool m_bOwned;
- WinAndId(const OString &rId, Window *pWindow)
+ WinAndId(const OString &rId, Window *pWindow, bool bVertical)
: m_sID(rId)
, m_pWindow(pWindow)
- , m_nPosition(-1)
+ , m_aPackingData(bVertical)
, m_bOwned(true)
{
}
@@ -192,7 +204,7 @@ private:
void handleAdjustment(const OString &rID, stringmap &rProperties);
void handleTabChild(Window *pParent, xmlreader::XmlReader &reader);
- sal_Int32 get_window_packing_position(const Window *pWindow) const;
+ PackingData get_window_packing_data(const Window *pWindow) const;
void set_window_packing_position(const Window *pWindow, sal_Int32 nPosition);
//Helpers to retrofit all the existing code the the builder
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 3e0fe34..328d904 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -570,6 +570,7 @@ extern "C" { static void SAL_CALL thisModule() {} }
Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OString &id, stringmap &rMap)
{
bool bIsPlaceHolder = name.isEmpty();
+ bool bVertical = false;
if (pParent && pParent->GetType() == WINDOW_TABCONTROL)
{
@@ -594,14 +595,14 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
OString sTabPageId = get_by_window(pParent) +
OString("-page") +
OString::valueOf(static_cast<sal_Int32>(nNewPageCount));
- m_aChildren.push_back(WinAndId(sTabPageId, pPage));
+ m_aChildren.push_back(WinAndId(sTabPageId, pPage, false));
pPage->SetHelpId(m_sHelpRoot + sTabPageId);
//And give the page one container as a child to make it a layout enabled
//tab page
VclBin* pContainer = new VclBin(pPage);
pContainer->Show();
- m_aChildren.push_back(WinAndId(OString(), pContainer));
+ m_aChildren.push_back(WinAndId(OString(), pContainer, false));
pContainer->SetHelpId(m_sHelpRoot + sTabPageId + OString("-bin"));
pParent = pContainer;
@@ -622,14 +623,16 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
}
else if (name == "GtkBox")
{
- if (extractOrientation(rMap))
+ bVertical = extractOrientation(rMap);
+ if (bVertical)
pWindow = new VclVBox(pParent);
else
pWindow = new VclHBox(pParent);
}
else if (name == "GtkButtonBox")
{
- if (extractOrientation(rMap))
+ bVertical = extractOrientation(rMap);
+ if (bVertical)
pWindow = new VclVButtonBox(pParent);
else
pWindow = new VclHButtonBox(pParent);
@@ -742,7 +745,8 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
}
else if (name == "GtkSeparator")
{
- if (extractOrientation(rMap))
+ bVertical = extractOrientation(rMap);
+ if (bVertical)
pWindow = new FixedLine(pParent, WB_VERT);
else
pWindow = new FixedLine(pParent, WB_HORZ);
@@ -750,7 +754,8 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
else if (name == "GtkScrollbar")
{
extractScrollAdjustment(id, rMap);
- if (extractOrientation(rMap))
+ bVertical = extractOrientation(rMap);
+ if (bVertical)
pWindow = new ScrollBar(pParent, WB_VERT);
else
pWindow = new ScrollBar(pParent, WB_HORZ);
@@ -830,7 +835,7 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
pWindow->mpWindowImpl->mpRealParent << "/" <<
pWindow->mpWindowImpl->mpBorderWindow << ") with helpid " <<
pWindow->GetHelpId().getStr());
- m_aChildren.push_back(WinAndId(id, pWindow));
+ m_aChildren.push_back(WinAndId(id, pWindow, bVertical));
}
return pWindow;
}
@@ -1042,15 +1047,27 @@ bool VclBuilder::sortIntoBestTabTraversalOrder::operator()(const Window *pA, con
return true;
if (ePackA > ePackB)
return false;
- //group secondaries before primaries
+ bool bVerticalContainer = m_pBuilder->get_window_packing_data(pA->GetParent()).m_bVerticalOrient;
bool bPackA = pA->get_secondary();
bool bPackB = pB->get_secondary();
- if (bPackA > bPackB)
- return true;
- if (bPackA < bPackB)
- return false;
+ if (!bVerticalContainer)
+ {
+ //for horizontal boxes group secondaries before primaries
+ if (bPackA > bPackB)
+ return true;
+ if (bPackA < bPackB)
+ return false;
+ }
+ else
+ {
+ //for vertical boxes group secondaries after primaries
+ if (bPackA < bPackB)
+ return true;
+ if (bPackA > bPackB)
+ return false;
+ }
//honour relative box positions with pack group
- return m_pBuilder->get_window_packing_position(pA) < m_pBuilder->get_window_packing_position(pB);
+ return m_pBuilder->get_window_packing_data(pA).m_nPosition < m_pBuilder->get_window_packing_data(pB).m_nPosition;
}
void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader)
@@ -1582,7 +1599,7 @@ OString VclBuilder::get_by_window(const Window *pWindow) const
return OString();
}
-sal_Int32 VclBuilder::get_window_packing_position(const Window *pWindow) const
+VclBuilder::PackingData VclBuilder::get_window_packing_data(const Window *pWindow) const
{
//We've stored the return of new Control, some of these get
//border windows placed around them which are what you get
@@ -1595,10 +1612,10 @@ sal_Int32 VclBuilder::get_window_packing_position(const Window *pWindow) const
aEnd = m_aChildren.end(); aI != aEnd; ++aI)
{
if (aI->m_pWindow == pPropHolder)
- return aI->m_nPosition;
+ return aI->m_aPackingData;
}
- return -1;
+ return PackingData();
}
void VclBuilder::set_window_packing_position(const Window *pWindow, sal_Int32 nPosition)
@@ -1607,7 +1624,7 @@ void VclBuilder::set_window_packing_position(const Window *pWindow, sal_Int32 nP
aEnd = m_aChildren.end(); aI != aEnd; ++aI)
{
if (aI->m_pWindow == pWindow)
- aI->m_nPosition = nPosition;
+ aI->m_aPackingData.m_nPosition = nPosition;
}
}
commit 3f7f957e68203bc7629934651196c9fbcce6108a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Nov 5 10:35:09 2012 +0000
convert macro dialog to .ui format
Change-Id: I5c832f3eaa6aefe2d652173289ef306e8743d4e0
diff --git a/cui/UI_cui.mk b/cui/UI_cui.mk
index a4df7be..119f8d6 100644
--- a/cui/UI_cui.mk
+++ b/cui/UI_cui.mk
@@ -17,6 +17,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\
cui/uiconfig/ui/insertoleobject \
cui/uiconfig/ui/insertplugin \
cui/uiconfig/ui/insertrowcolumn \
+ cui/uiconfig/ui/scriptorganizer \
cui/uiconfig/ui/macroselectordialog \
cui/uiconfig/ui/positionpage \
cui/uiconfig/ui/specialcharacters \
diff --git a/cui/source/customize/acccfg.hrc b/cui/source/customize/acccfg.hrc
index 63c24e7..fbcd2d3 100644
--- a/cui/source/customize/acccfg.hrc
+++ b/cui/source/customize/acccfg.hrc
@@ -36,12 +36,6 @@
#define STR_LOADACCELCONFIG 46
#define STR_SAVEACCELCONFIG 47
-#define IMG_HARDDISK 48
-#define STR_PRODMACROS 50
-#define STR_MYMACROS 51
-#define IMG_LIB 52
-#define IMG_MACRO 54
-#define IMG_DOC 56
#define STR_GROUP_STYLES 58
#define STR_PDF_EXPORT_SEND 59
#define IMG_INFO 61
@@ -49,6 +43,5 @@
#define BMP_COLLAPSED 63
#define BMP_EXPANDED 64
#define STR_BASICMACROS 67
-#define STR_DLG_MACROS 68
#define STR_HUMAN_APPNAME 69
#define STR_FILTERNAME_CFG 70
diff --git a/cui/source/customize/acccfg.src b/cui/source/customize/acccfg.src
index c1b0322..1eaf6f3 100644
--- a/cui/source/customize/acccfg.src
+++ b/cui/source/customize/acccfg.src
@@ -198,22 +198,10 @@ TabPage RID_SVXPAGE_KEYBOARD
Resource RID_SVXPAGE_CONFIGGROUPBOX
{
- String STR_MYMACROS
- {
- Text [ en-US ] = "My Macros";
- };
- String STR_PRODMACROS
- {
- Text [ en-US ] = "%PRODUCTNAME Macros";
- };
String STR_BASICMACROS
{
Text [ en-US ] = "BASIC Macros" ;
};
- String STR_DLG_MACROS
- {
- Text [ en-US ] = "%PRODUCTNAME Macros" ;
- };
String STR_HUMAN_APPNAME
{
TEXT = "%PRODUCTNAME" ;
@@ -222,26 +210,6 @@ Resource RID_SVXPAGE_CONFIGGROUPBOX
{
Text [ en-US ] = "Styles" ;
};
- Image IMG_HARDDISK
- {
- ImageBitmap = Bitmap { File = "harddisk_16.bmp" ; };
- MASKCOLOR
- };
- Image IMG_LIB
- {
- ImageBitmap = Bitmap { File = "im30820.png"; };
- MASKCOLOR
- };
- Image IMG_MACRO
- {
- ImageBitmap = Bitmap { File = "im30821.png"; };
- MASKCOLOR
- };
- Image IMG_DOC
- {
- ImageBitmap = Bitmap { File = "im30826.png"; };
- MASKCOLOR
- };
Image BMP_COLLAPSED
{
ImageBitmap = Bitmap
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 61db17f..e79f1c6 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -387,16 +387,16 @@ struct SvxConfigGroupBoxResource_Impl : public Resource
SvxConfigGroupBoxResource_Impl::SvxConfigGroupBoxResource_Impl() :
Resource(CUI_RES(RID_SVXPAGE_CONFIGGROUPBOX)),
- m_hdImage(CUI_RES(IMG_HARDDISK)),
- m_libImage(CUI_RES(IMG_LIB)),
- m_macImage(CUI_RES(IMG_MACRO)),
- m_docImage(CUI_RES(IMG_DOC)),
- m_sMyMacros(String(CUI_RES(STR_MYMACROS))),
- m_sProdMacros(String(CUI_RES(STR_PRODMACROS))),
- m_sMacros(String(CUI_RES(STR_BASICMACROS))),
- m_sDlgMacros(String(CUI_RES(STR_DLG_MACROS))),
- m_aHumanAppName(String(CUI_RES(STR_HUMAN_APPNAME))),
- m_aStrGroupStyles(String(CUI_RES(STR_GROUP_STYLES))),
+ m_hdImage(CUI_RES(RID_CUIIMG_HARDDISK)),
+ m_libImage(CUI_RES(RID_CUIIMG_LIB)),
+ m_macImage(CUI_RES(RID_CUIIMG_MACRO)),
+ m_docImage(CUI_RES(RID_CUIIMG_DOC)),
+ m_sMyMacros(CUI_RESSTR(RID_SVXSTR_MYMACROS)),
+ m_sProdMacros(CUI_RESSTR(RID_SVXSTR_PRODMACROS)),
+ m_sMacros(CUI_RESSTR(STR_BASICMACROS)),
+ m_sDlgMacros(CUI_RESSTR(RID_SVXSTR_PRODMACROS)),
+ m_aHumanAppName(CUI_RESSTR(STR_HUMAN_APPNAME)),
+ m_aStrGroupStyles(CUI_RESSTR(STR_GROUP_STYLES)),
m_collapsedImage(CUI_RES(BMP_COLLAPSED)),
m_expandedImage(CUI_RES(BMP_EXPANDED))
{
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index b071764..d601623 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -71,16 +71,8 @@ void ShowErrorDialog( const Any& aException )
delete pDlg;
}
-SFTreeListBox::SFTreeListBox( Window* pParent, const ResId& rResId ) :
- SvTreeListBox( pParent, ResId( rResId.GetId(),*rResId.GetResMgr() ) ),
- m_hdImage(ResId(IMG_HARDDISK,*rResId.GetResMgr())),
- m_libImage(ResId(IMG_LIB,*rResId.GetResMgr())),
- m_macImage(ResId(IMG_MACRO,*rResId.GetResMgr())),
- m_docImage(ResId(IMG_DOCUMENT,*rResId.GetResMgr())),
- m_sMyMacros(String(ResId(STR_MYMACROS,*rResId.GetResMgr()))),
- m_sProdMacros(String(ResId(STR_PRODMACROS,*rResId.GetResMgr())))
+void SFTreeListBox::Init()
{
- FreeResource();
SetSelectionMode( SINGLE_SELECTION );
SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL |
@@ -91,6 +83,36 @@ SFTreeListBox::SFTreeListBox( Window* pParent, const ResId& rResId ) :
nMode = 0xFF; // everything
}
+SFTreeListBox::SFTreeListBox(Window* pParent, const ResId& rResId)
+ : SvTreeListBox(pParent, ResId(rResId.GetId(),*rResId.GetResMgr()))
+ , m_hdImage(CUI_RES(RID_CUIIMG_HARDDISK))
+ , m_libImage(CUI_RES(RID_CUIIMG_LIB))
+ , m_macImage(CUI_RES(RID_CUIIMG_MACRO))
+ , m_docImage(CUI_RES(RID_CUIIMG_DOC))
+ , m_sMyMacros(CUI_RESSTR(RID_SVXSTR_MYMACROS))
+ , m_sProdMacros(CUI_RES(RID_SVXSTR_PRODMACROS))
+{
+ FreeResource();
+ Init();
+}
+
+SFTreeListBox::SFTreeListBox(Window* pParent)
+ : SvTreeListBox(pParent)
+ , m_hdImage(CUI_RES(RID_CUIIMG_HARDDISK))
+ , m_libImage(CUI_RES(RID_CUIIMG_LIB))
+ , m_macImage(CUI_RES(RID_CUIIMG_MACRO))
+ , m_docImage(CUI_RES(RID_CUIIMG_DOC))
+ , m_sMyMacros(CUI_RESSTR(RID_SVXSTR_MYMACROS))
+ , m_sProdMacros(CUI_RESSTR(RID_SVXSTR_PRODMACROS))
+{
+ Init();
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSFTreeListBox(Window *pParent, VclBuilder::stringmap &)
+{
+ return new SFTreeListBox(pParent);
+}
+
SFTreeListBox::~SFTreeListBox()
{
deleteAllTree();
@@ -235,7 +257,7 @@ void SFTreeListBox::Init( const ::rtl::OUString& language )
getLangNodeFromRootNode( children[ n ], lang );
SAL_WNODEPRECATED_DECLARATIONS_PUSH
- insertEntry( uiName, app ? IMG_HARDDISK : IMG_DOCUMENT,
+ insertEntry( uiName, app ? RID_CUIIMG_HARDDISK : RID_CUIIMG_DOC,
0, true, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SFROOT, langEntries, xDocumentModel )), factoryURL );
SAL_WNODEPRECATED_DECLARATIONS_POP
}
@@ -324,7 +346,7 @@ void SFTreeListBox:: RequestSubEntries( SvTreeListEntry* pRootEntry, Reference<
if ( children[ n ]->getType() != browse::BrowseNodeTypes::SCRIPT)
{
SAL_WNODEPRECATED_DECLARATIONS_PUSH
- insertEntry( name, IMG_LIB, pRootEntry, true, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, children[ n ],model )));
+ insertEntry( name, RID_CUIIMG_LIB, pRootEntry, true, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, children[ n ],model )));
SAL_WNODEPRECATED_DECLARATIONS_POP
}
else
@@ -332,7 +354,7 @@ void SFTreeListBox:: RequestSubEntries( SvTreeListEntry* pRootEntry, Reference<
if ( children[ n ]->getType() == browse::BrowseNodeTypes::SCRIPT )
{
SAL_WNODEPRECATED_DECLARATIONS_PUSH
- insertEntry( name, IMG_MACRO, pRootEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, children[ n ],model )));
+ insertEntry( name, RID_CUIIMG_MACRO, pRootEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, children[ n ],model )));
SAL_WNODEPRECATED_DECLARATIONS_POP
}
@@ -355,7 +377,7 @@ SvTreeListEntry * SFTreeListBox::insertEntry(
bool bChildrenOnDemand, std::auto_ptr< SFEntry > aUserData, ::rtl::OUString factoryURL )
{
SvTreeListEntry * p;
- if( nBitmap == IMG_DOCUMENT && !factoryURL.isEmpty() )
+ if( nBitmap == RID_CUIIMG_DOC && !factoryURL.isEmpty() )
{
Image aImage = SvFileInformationManager::GetFileImage( INetURLObject(factoryURL), false );
p = InsertEntry(
@@ -376,19 +398,19 @@ SvTreeListEntry * SFTreeListBox::insertEntry(
bool bChildrenOnDemand, std::auto_ptr< SFEntry > aUserData )
{
Image aImage;
- if( nBitmap == IMG_HARDDISK )
+ if( nBitmap == RID_CUIIMG_HARDDISK )
{
aImage = m_hdImage;
}
- else if( nBitmap == IMG_LIB )
+ else if( nBitmap == RID_CUIIMG_LIB )
{
aImage = m_libImage;
}
- else if( nBitmap == IMG_MACRO )
+ else if( nBitmap == RID_CUIIMG_MACRO )
{
aImage = m_macImage;
}
- else if( nBitmap == IMG_DOCUMENT )
+ else if( nBitmap == RID_CUIIMG_DOC )
{
aImage = m_docImage;
}
@@ -488,57 +510,53 @@ CuiInputDialog::~CuiInputDialog()
// ScriptOrgDialog ------------------------------------------------------------
// ----------------------------------------------------------------------------
SvxScriptOrgDialog::SvxScriptOrgDialog( Window* pParent, ::rtl::OUString language )
- : SfxModalDialog( pParent, CUI_RES( RID_DLG_SCRIPTORGANIZER ) ),
- aScriptsTxt( this, CUI_RES( SF_TXT_SCRIPTS ) ),
- aScriptsBox( this, CUI_RES( SF_CTRL_SCRIPTSBOX ) ),
- aRunButton( this, CUI_RES( SF_PB_RUN ) ),
- aCloseButton( this, CUI_RES( SF_PB_CLOSE ) ),
- aCreateButton( this, CUI_RES( SF_PB_CREATE ) ),
- aEditButton( this, CUI_RES( SF_PB_EDIT ) ),
- aRenameButton(this, CUI_RES( SF_PB_RENAME ) ),
- aDelButton( this, CUI_RES( SF_PB_DEL ) ),
- aHelpButton( this, CUI_RES( SF_PB_HELP ) ),
- m_sLanguage( language ),
- m_delErrStr( CUI_RES( RID_SVXSTR_DELFAILED ) ),
- m_delErrTitleStr( CUI_RES( RID_SVXSTR_DELFAILED_TITLE ) ),
- m_delQueryStr( CUI_RES( RID_SVXSTR_DELQUERY ) ),
- m_delQueryTitleStr( CUI_RES( RID_SVXSTR_DELQUERY_TITLE ) ) ,
- m_createErrStr( CUI_RES ( RID_SVXSTR_CREATEFAILED ) ),
- m_createDupStr( CUI_RES ( RID_SVXSTR_CREATEFAILEDDUP ) ),
- m_createErrTitleStr( CUI_RES( RID_SVXSTR_CREATEFAILED_TITLE ) ),
- m_renameErrStr( CUI_RES ( RID_SVXSTR_RENAMEFAILED ) ),
- m_renameErrTitleStr( CUI_RES( RID_SVXSTR_RENAMEFAILED_TITLE ) )
+ : SfxModalDialog(pParent, "ScriptOrganizerDialog", "cui/ui/scriptorganizer.ui")
+ , m_sLanguage(language)
+ , m_delErrStr(CUI_RESSTR(RID_SVXSTR_DELFAILED))
+ , m_delErrTitleStr(CUI_RESSTR(RID_SVXSTR_DELFAILED_TITLE))
+ , m_delQueryStr(CUI_RES(RID_SVXSTR_DELQUERY))
+ , m_delQueryTitleStr(CUI_RESSTR(RID_SVXSTR_DELQUERY_TITLE))
+ , m_createErrStr(CUI_RESSTR(RID_SVXSTR_CREATEFAILED))
+ , m_createDupStr(CUI_RESSTR(RID_SVXSTR_CREATEFAILEDDUP))
+ , m_createErrTitleStr(CUI_RESSTR(RID_SVXSTR_CREATEFAILED_TITLE))
+ , m_renameErrStr(CUI_RESSTR(RID_SVXSTR_RENAMEFAILED))
+ , m_renameErrTitleStr(CUI_RESSTR(RID_SVXSTR_RENAMEFAILED_TITLE))
{
-
+ get(m_pScriptsBox, "scripts");
+ get(m_pRunButton, "run");
+ get(m_pCloseButton, "close");
+ get(m_pCreateButton, "create");
+ get(m_pEditButton, "edit");
+ get(m_pRenameButton, "rename");
+ get(m_pDelButton, "delete");
// must be a neater way to deal with the strings than as above
// append the language to the dialog title
String winTitle( GetText() );
winTitle.SearchAndReplace( rtl::OUString( "%MACROLANG" ), m_sLanguage );
SetText( winTitle );
- aScriptsBox.SetSelectHdl( LINK( this, SvxScriptOrgDialog, ScriptSelectHdl ) );
- aRunButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
- aCloseButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
- aRenameButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
- aEditButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
- aDelButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
- aCreateButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
-
- aRunButton.Disable();
- aRenameButton.Disable();
- aEditButton.Disable();
- aDelButton.Disable();
- aCreateButton.Disable();
-
- aScriptsBox.Init( m_sLanguage );
+ m_pScriptsBox->SetSelectHdl( LINK( this, SvxScriptOrgDialog, ScriptSelectHdl ) );
+ m_pRunButton->SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
+ m_pCloseButton->SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
+ m_pRenameButton->SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
+ m_pEditButton->SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
+ m_pDelButton->SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
+ m_pCreateButton->SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
+
+ m_pRunButton->Disable();
+ m_pRenameButton->Disable();
+ m_pEditButton->Disable();
+ m_pDelButton->Disable();
+ m_pCreateButton->Disable();
+
+ m_pScriptsBox->Init( m_sLanguage );
RestorePreviousSelection();
- FreeResource();
}
SvxScriptOrgDialog::~SvxScriptOrgDialog()
{
// clear the SelectHdl so that it isn't called during the dtor
- aScriptsBox.SetSelectHdl( Link() );
+ m_pScriptsBox->SetSelectHdl( Link() );
};
short SvxScriptOrgDialog::Execute()
@@ -560,7 +578,7 @@ short SvxScriptOrgDialog::Execute()
pDoc = SfxObjectShell::GetNext(*pDoc);
}
- aScriptsBox.ExpandAllTrees();
+ m_pScriptsBox->ExpandAllTrees();
Window* pPrevDlgParent = Application::GetDefDialogParent();
Application::SetDefDialogParent( this );
@@ -575,20 +593,20 @@ void SvxScriptOrgDialog::CheckButtons( Reference< browse::XBrowseNode >& node )
{
if ( node->getType() == browse::BrowseNodeTypes::SCRIPT)
{
- aRunButton.Enable();
+ m_pRunButton->Enable();
}
else
{
- aRunButton.Disable();
+ m_pRunButton->Disable();
}
Reference< beans::XPropertySet > xProps( node, UNO_QUERY );
if ( !xProps.is() )
{
- aEditButton.Disable();
- aDelButton.Disable();
- aCreateButton.Disable();
- aRunButton.Disable();
+ m_pEditButton->Disable();
+ m_pDelButton->Disable();
+ m_pCreateButton->Disable();
+ m_pRunButton->Disable();
return;
}
@@ -596,54 +614,54 @@ void SvxScriptOrgDialog::CheckButtons( Reference< browse::XBrowseNode >& node )
if ( getBoolProperty( xProps, sName ) )
{
- aEditButton.Enable();
+ m_pEditButton->Enable();
}
else
{
- aEditButton.Disable();
+ m_pEditButton->Disable();
}
sName = rtl::OUString("Deletable") ;
if ( getBoolProperty( xProps, sName ) )
{
- aDelButton.Enable();
+ m_pDelButton->Enable();
}
else
{
- aDelButton.Disable();
+ m_pDelButton->Disable();
}
sName = rtl::OUString("Creatable") ;
if ( getBoolProperty( xProps, sName ) )
{
- aCreateButton.Enable();
+ m_pCreateButton->Enable();
}
else
{
- aCreateButton.Disable();
+ m_pCreateButton->Disable();
}
sName = rtl::OUString("Renamable") ;
if ( getBoolProperty( xProps, sName ) )
{
- aRenameButton.Enable();
+ m_pRenameButton->Enable();
}
else
{
- aRenameButton.Disable();
+ m_pRenameButton->Disable();
}
}
else
{
// no node info available, disable all configurable actions
- aDelButton.Disable();
- aCreateButton.Disable();
- aEditButton.Disable();
- aRunButton.Disable();
- aRenameButton.Disable();
+ m_pDelButton->Disable();
+ m_pCreateButton->Disable();
+ m_pEditButton->Disable();
+ m_pRunButton->Disable();
+ m_pRenameButton->Disable();
}
}
@@ -675,21 +693,21 @@ IMPL_LINK( SvxScriptOrgDialog, ScriptSelectHdl, SvTreeListBox *, pBox )
IMPL_LINK( SvxScriptOrgDialog, ButtonHdl, Button *, pButton )
{
- if ( pButton == &aCloseButton )
+ if ( pButton == m_pCloseButton )
{
StoreCurrentSelection();
EndDialog( 0 );
}
- if ( pButton == &aEditButton ||
- pButton == &aCreateButton ||
- pButton == &aDelButton ||
- pButton == &aRunButton ||
- pButton == &aRenameButton )
+ if ( pButton == m_pEditButton ||
+ pButton == m_pCreateButton ||
+ pButton == m_pDelButton ||
+ pButton == m_pRunButton ||
+ pButton == m_pRenameButton )
{
- if ( aScriptsBox.IsSelected( aScriptsBox.GetHdlEntry() ) )
+ if ( m_pScriptsBox->IsSelected( m_pScriptsBox->GetHdlEntry() ) )
{
- SvTreeListEntry* pEntry = aScriptsBox.GetHdlEntry();
+ SvTreeListEntry* pEntry = m_pScriptsBox->GetHdlEntry();
SFEntry* userData = 0;
if ( !pEntry )
{
@@ -709,7 +727,7 @@ IMPL_LINK( SvxScriptOrgDialog, ButtonHdl, Button *, pButton )
return 0;
}
- if ( pButton == &aRunButton )
+ if ( pButton == m_pRunButton )
{
::rtl::OUString tmpString;
Reference< beans::XPropertySet > xProp( node, UNO_QUERY );
@@ -735,12 +753,12 @@ IMPL_LINK( SvxScriptOrgDialog, ButtonHdl, Button *, pButton )
}
- SvTreeListEntry* pParent = aScriptsBox.GetParent( pEntry );
+ SvTreeListEntry* pParent = m_pScriptsBox->GetParent( pEntry );
while ( pParent && !mspNode.is() )
{
SFEntry* mspUserData = (SFEntry*)pParent->GetUserData();
mspNode.set( mspUserData->GetNode() , UNO_QUERY );
- pParent = aScriptsBox.GetParent( pParent );
+ pParent = m_pScriptsBox->GetParent( pParent );
}
xProp->getPropertyValue( rtl::OUString("URI" ) ) >>= tmpString;
const String scriptURL( tmpString );
@@ -782,7 +800,7 @@ IMPL_LINK( SvxScriptOrgDialog, ButtonHdl, Button *, pButton )
StoreCurrentSelection();
EndDialog( 0 );
}
- else if ( pButton == &aEditButton )
+ else if ( pButton == m_pEditButton )
{
Reference< script::XInvocation > xInv( node, UNO_QUERY );
if ( xInv.is() )
@@ -804,15 +822,15 @@ IMPL_LINK( SvxScriptOrgDialog, ButtonHdl, Button *, pButton )
}
}
}
- else if ( pButton == &aCreateButton )
+ else if ( pButton == m_pCreateButton )
{
createEntry( pEntry );
}
- else if ( pButton == &aDelButton )
+ else if ( pButton == m_pDelButton )
{
deleteEntry( pEntry );
}
- else if ( pButton == &aRenameButton )
+ else if ( pButton == m_pRenameButton )
{
renameEntry( pEntry );
}
@@ -864,7 +882,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
::rtl::OUString aNewName;
::rtl::OUString aNewStdName;
sal_uInt16 nMode = INPUTMODE_NEWLIB;
- if( aScriptsBox.GetModel()->GetDepth( pEntry ) == 0 )
+ if( m_pScriptsBox->GetModel()->GetDepth( pEntry ) == 0 )
{
aNewStdName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Library") ) ;
}
@@ -967,7 +985,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
while ( !bValid );
// open up parent node (which ensures it's loaded)
- aScriptsBox.RequestingChildren( pEntry );
+ m_pScriptsBox->RequestingChildren( pEntry );
Sequence< Any > args( 1 );
args[ 0 ] <<= aNewName;
@@ -1006,16 +1024,16 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
if ( aChildNode->getType() == browse::BrowseNodeTypes::SCRIPT )
{
SAL_WNODEPRECATED_DECLARATIONS_PUSH
- pNewEntry = aScriptsBox.insertEntry( aChildName,
- IMG_MACRO, pEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, aChildNode,xDocumentModel ) ) );
+ pNewEntry = m_pScriptsBox->insertEntry( aChildName,
+ RID_CUIIMG_MACRO, pEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, aChildNode,xDocumentModel ) ) );
SAL_WNODEPRECATED_DECLARATIONS_POP
}
else
{
SAL_WNODEPRECATED_DECLARATIONS_PUSH
- pNewEntry = aScriptsBox.insertEntry( aChildName,
- IMG_LIB, pEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) ) );
+ pNewEntry = m_pScriptsBox->insertEntry( aChildName,
+ RID_CUIIMG_LIB, pEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) ) );
SAL_WNODEPRECATED_DECLARATIONS_POP
// If the Parent is not loaded then set to
@@ -1028,8 +1046,8 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
userData->setLoaded();
}
}
- aScriptsBox.SetCurEntry( pNewEntry );
- aScriptsBox.Select( aScriptsBox.GetCurEntry() );
+ m_pScriptsBox->SetCurEntry( pNewEntry );
+ m_pScriptsBox->Select( m_pScriptsBox->GetCurEntry() );
}
else
@@ -1105,9 +1123,9 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry )
}
if ( aChildNode.is() )
{
- aScriptsBox.SetEntryText( pEntry, aChildNode->getName() );
- aScriptsBox.SetCurEntry( pEntry );
- aScriptsBox.Select( aScriptsBox.GetCurEntry() );
+ m_pScriptsBox->SetEntryText( pEntry, aChildNode->getName() );
+ m_pScriptsBox->SetCurEntry( pEntry );
+ m_pScriptsBox->Select( m_pScriptsBox->GetCurEntry() );
}
else
@@ -1155,8 +1173,8 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
if ( result == sal_True )
{
- aScriptsBox.deleteTree( pEntry );
- aScriptsBox.GetModel()->Remove( pEntry );
+ m_pScriptsBox->deleteTree( pEntry );
+ m_pScriptsBox->GetModel()->Remove( pEntry );
}
else
{
@@ -1220,13 +1238,13 @@ Selection_hash SvxScriptOrgDialog::m_lastSelection;
void SvxScriptOrgDialog::StoreCurrentSelection()
{
String aDescription;
- if ( aScriptsBox.IsSelected( aScriptsBox.GetHdlEntry() ) )
+ if ( m_pScriptsBox->IsSelected( m_pScriptsBox->GetHdlEntry() ) )
{
- SvTreeListEntry* pEntry = aScriptsBox.GetHdlEntry();
+ SvTreeListEntry* pEntry = m_pScriptsBox->GetHdlEntry();
while( pEntry )
{
- aDescription.Insert( aScriptsBox.GetEntryText( pEntry ), 0 );
- pEntry = aScriptsBox.GetParent( pEntry );
+ aDescription.Insert( m_pScriptsBox->GetEntryText( pEntry ), 0 );
+ pEntry = m_pScriptsBox->GetParent( pEntry );
if ( pEntry )
aDescription.Insert( ';', 0 );
}
@@ -1245,21 +1263,21 @@ void SvxScriptOrgDialog::RestorePreviousSelection()
while ( nIndex != STRING_NOTFOUND )
{
String aTmp( aStoredEntry.GetToken( 0, ';', nIndex ) );
- SvTreeListEntry* pTmpEntry = aScriptsBox.FirstChild( pEntry );
+ SvTreeListEntry* pTmpEntry = m_pScriptsBox->FirstChild( pEntry );
while ( pTmpEntry )
{
- if ( aScriptsBox.GetEntryText( pTmpEntry ) == aTmp )
+ if ( m_pScriptsBox->GetEntryText( pTmpEntry ) == aTmp )
{
pEntry = pTmpEntry;
break;
}
- pTmpEntry = aScriptsBox.NextSibling( pTmpEntry );
+ pTmpEntry = m_pScriptsBox->NextSibling( pTmpEntry );
}
if ( !pTmpEntry )
break;
- aScriptsBox.RequestingChildren( pEntry );
+ m_pScriptsBox->RequestingChildren( pEntry );
}
- aScriptsBox.SetCurEntry( pEntry );
+ m_pScriptsBox->SetCurEntry( pEntry );
}
::rtl::OUString ReplaceString(
diff --git a/cui/source/dialogs/scriptdlg.hrc b/cui/source/dialogs/scriptdlg.hrc
index cb3b501..02c0c0e 100644
--- a/cui/source/dialogs/scriptdlg.hrc
+++ b/cui/source/dialogs/scriptdlg.hrc
@@ -21,22 +21,6 @@
#include <svl/solar.hrc>
-// ScriptOrgDialog
-#define SF_TXT_SCRIPTS 1
-#define SF_CTRL_SCRIPTSBOX 2
-#define SF_PB_RUN 3
-#define SF_PB_CLOSE 4
-#define SF_PB_CREATE 5
-#define SF_PB_EDIT 6
-#define SF_PB_RENAME 7
-#define SF_PB_DEL 8
-#define SF_PB_HELP 9
-
-#define IMG_HARDDISK 1
-#define IMG_LIB 3
-#define IMG_MACRO 5
-#define IMG_DOCUMENT 7
-
// NewObjectDialog
#define FT_NEWLIB 10
#define STR_FT_NEWMACRO 11
@@ -48,15 +32,4 @@
#define STR_FT_RENAME 18
#define STR_RENAME 19
-// Others
-/*
-Please be aware that these strings are global resources, don't use self-defined values!
-You have to use the RID_SVXSTART macro do avoid ID clashes with other resource files. Sfx2 delivers
-some of its own resource files to svx - where they are added to svx resource file!!
-*/
-
-#define STR_MYMACROS 32
-#define STR_PRODMACROS 33
-
-
-#endif // _SCRIPTDLG_HRC
+#endif
diff --git a/cui/source/dialogs/scriptdlg.src b/cui/source/dialogs/scriptdlg.src
index 2ef2558..ba87970 100644
--- a/cui/source/dialogs/scriptdlg.src
+++ b/cui/source/dialogs/scriptdlg.src
@@ -20,116 +20,6 @@
#include "scriptdlg.hrc"
#include "helpid.hrc"
-#define MASKCOLOR MaskColor = \
- Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
-
-ModalDialog RID_DLG_SCRIPTORGANIZER
-{
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 210 , 165 ) ;
- Moveable = TRUE ;
- Text [ en-US ] = "%MACROLANG Macros";
- Closeable = TRUE ;
- HelpId = HID_SCRIPTORG_DIALOG;
- FixedText SF_TXT_SCRIPTS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- Text [ en-US ] = "~Macros" ;
- };
-
- Control SF_CTRL_SCRIPTSBOX
- {
- HelpId = HID_SCRIPTSBOX ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 16 ) ;
- Size = MAP_APPFONT ( 130 , 144 ) ;
- TabStop = TRUE ;
- Image IMG_HARDDISK
- {
- ImageBitmap = Bitmap { File = "harddisk_16.bmp" ; };
- MASKCOLOR
- };
- Image IMG_LIB
- {
- ImageBitmap = Bitmap { File = "im30820.png"; };
- MASKCOLOR
- };
- Image IMG_MACRO
- {
- ImageBitmap = Bitmap { File = "im30821.png"; };
- MASKCOLOR
- };
- Image IMG_DOCUMENT
- {
- ImageBitmap = Bitmap { File = "im30826.png"; };
- MASKCOLOR
- };
- String STR_MYMACROS
- {
- Text [ en-US ] = "My Macros";
- };
- String STR_PRODMACROS
- {
- Text [ en-US ] = "%PRODUCTNAME Macros";
- };
- };
-
- PushButton SF_PB_RUN
- {
- HelpID = "cui:PushButton:RID_DLG_SCRIPTORGANIZER:SF_PB_RUN";
- Pos = MAP_APPFONT ( 144 , 6 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- DefButton = TRUE;
- Text [ en-US ] = "R~un" ;
- };
- CancelButton SF_PB_CLOSE
- {
- Pos = MAP_APPFONT ( 144 , 23 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Close" ;
- };
-
- PushButton SF_PB_CREATE
- {
- HelpID = "cui:PushButton:RID_DLG_SCRIPTORGANIZER:SF_PB_CREATE";
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Pos = MAP_APPFONT ( 144 , 60 ) ;
- Text [ en-US ] = "~Create..." ;
- TabStop = TRUE ;
- };
- PushButton SF_PB_EDIT
- {
- HelpID = "cui:PushButton:RID_DLG_SCRIPTORGANIZER:SF_PB_EDIT";
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Pos = MAP_APPFONT ( 144 , 77 ) ;
- Text [ en-US ] = "~Edit" ;
- TabStop = TRUE ;
- };
- PushButton SF_PB_RENAME
- {
- HelpID = "cui:PushButton:RID_DLG_SCRIPTORGANIZER:SF_PB_RENAME";
- Pos = MAP_APPFONT ( 144 , 94 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "Rename..." ;
- };
- PushButton SF_PB_DEL
- {
- HelpID = "cui:PushButton:RID_DLG_SCRIPTORGANIZER:SF_PB_DEL";
- Pos = MAP_APPFONT ( 144 , 114 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "~Delete..." ;
- TabStop = TRUE ;
- };
- HelpButton SF_PB_HELP
- {
- Pos = MAP_APPFONT ( 144 , 131 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- TabStop = TRUE ;
- };
-
-};
ModalDialog RID_DLG_NEWLIB
{
HelpID = "cui:ModalDialog:RID_DLG_NEWLIB";
diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc
index 8387eba..9f2b96a 100644
--- a/cui/source/inc/helpid.hrc
+++ b/cui/source/inc/helpid.hrc
@@ -250,8 +250,6 @@
#define HID_HANGULHANJA_EDIT_DLG "CUI_HID_HANGULHANJA_EDIT_DLG"
#define HID_HANGULHANJA_OPT_DICTS_LB "CUI_HID_HANGULHANJA_OPT_DICTS_LB"
#define HID_MULTIPATH "CUI_HID_MULTIPATH"
-#define HID_SCRIPTORG_DIALOG "CUI_HID_SCRIPTORG_DIALOG"
-#define HID_SCRIPTSBOX "CUI_HID_SCRIPTSBOX"
#define HID_SPELLCHECK "CUI_HID_SPELLCHECK"
#define HID_TPSIZE_CTRL "CUI_HID_TPSIZE_CTRL"
#define HID_TPROTATION_CTRL1 "CUI_HID_TPROTATION_CTRL1"
diff --git a/cui/source/inc/scriptdlg.hxx b/cui/source/inc/scriptdlg.hxx
index d1ec4d8..34d85aa 100644
--- a/cui/source/inc/scriptdlg.hxx
+++ b/cui/source/inc/scriptdlg.hxx
@@ -69,6 +69,8 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getDocumentModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xCtx, ::rtl::OUString& docName );
+ void Init();
+
protected:
void ExpandTree( SvTreeListEntry* pRootEntry );
virtual void RequestingChildren( SvTreeListEntry* pParent );
@@ -78,7 +80,8 @@ public:
void Init( const ::rtl::OUString& language );
void RequestSubEntries( SvTreeListEntry* pRootEntry, ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& node,
::com::sun::star::uno::Reference< com::sun::star::frame::XModel>& model );
- SFTreeListBox( Window* pParent, const ResId& rRes );
+ SFTreeListBox(Window* pParent, const ResId& rRes);
+ SFTreeListBox(Window* pParent);
~SFTreeListBox();
void ExpandAllTrees();
@@ -139,16 +142,14 @@ public:
class SvxScriptOrgDialog : public SfxModalDialog
{
protected:
- FixedText aScriptsTxt;
- SFTreeListBox aScriptsBox;
-
- PushButton aRunButton;
- CancelButton aCloseButton;
- PushButton aCreateButton;
- PushButton aEditButton;
- PushButton aRenameButton;
- PushButton aDelButton;
- HelpButton aHelpButton;
+ SFTreeListBox* m_pScriptsBox;
+
+ PushButton* m_pRunButton;
+ PushButton* m_pCloseButton;
+ PushButton* m_pCreateButton;
+ PushButton* m_pEditButton;
+ PushButton* m_pRenameButton;
+ PushButton* m_pDelButton;
::rtl::OUString m_sLanguage;
static Selection_hash m_lastSelection;
diff --git a/cui/uiconfig/ui/scriptorganizer.ui b/cui/uiconfig/ui/scriptorganizer.ui
new file mode 100644
index 0000000..d18bf8f
--- /dev/null
+++ b/cui/uiconfig/ui/scriptorganizer.ui
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="ScriptOrganizerDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">%MACROLANG Macros</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="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="layout_style">start</property>
+ <child>
+ <object class="GtkButton" id="run">
+ <property name="label">Run</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="close">
+ <property name="label">gtk-close</property>
+ <property name="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">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="create">
+ <property name="label">Create...</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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="edit">
+ <property name="label">gtk-edit</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>
+ <property name="image_position">bottom</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="rename">
+ <property name="label">Rename...</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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="delete">
+ <property name="label">Delete...</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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ <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">6</property>
+ <property name="secondary">True</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="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</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="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="cuilo:SFTreeListBox" id="scripts">
+ <property name="height_request">300</property>
+ <property name="width_request">280</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="macrosft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Macros</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">run</action-widget>
+ <action-widget response="0">close</action-widget>
+ <action-widget response="0">create</action-widget>
+ <action-widget response="0">edit</action-widget>
+ <action-widget response="0">rename</action-widget>
+ <action-widget response="0">delete</action-widget>
+ <action-widget response="0">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/cui/util/hidother.src b/cui/util/hidother.src
index 5f75101..3827af0 100644
--- a/cui/util/hidother.src
+++ b/cui/util/hidother.src
@@ -148,7 +148,6 @@ hidspecial HID_REDLINING_DLG { HelpID = HID_REDLINING_DLG; };
hidspecial HID_REDLINING_EDIT { HelpID = HID_REDLINING_EDIT; };
hidspecial HID_REDLINING_NEXT { HelpID = HID_REDLINING_NEXT; };
hidspecial HID_REDLINING_PREV { HelpID = HID_REDLINING_PREV; };
-hidspecial HID_SCRIPTSBOX { HelpId = HID_SCRIPTSBOX; };
hidspecial HID_SPLDLG_BUTTON_CHANGE { HelpID = HID_SPLDLG_BUTTON_CHANGE ; };
hidspecial HID_SPLDLG_BUTTON_CHANGEALL { HelpID = HID_SPLDLG_BUTTON_CHANGEALL ; };
hidspecial HID_SPLDLG_BUTTON_CLOSE { HelpID = HID_SPLDLG_BUTTON_CLOSE ; };
commit daccedee4bab468687be51c8452b09e71289dc23
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Nov 8 09:29:50 2012 +0000
WaE: unused variables on OSL_DEBUG_LEVEL > 1
Change-Id: I38b3e6502ba9159044e2b623ec0ee868b5a8d7a1
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 25ed85b..e436cdc 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -122,12 +122,6 @@ bool lcl_IsUnsupportedUnicodeChar( CharClass& rCC, const String& rTxt,
{
for( ; nStt < nEnd; ++nStt )
{
-#if OSL_DEBUG_LEVEL > 1
- sal_Int32 nCharType;
- sal_Int32 nChType;
- nCharType = rCC.getCharacterType( rTxt, nStt );
- nChType = rCC.getType( rTxt, nStt );
-#endif
short nScript = rCC.getScript( rTxt, nStt );
switch( nScript )
{
commit 89e47b8bf1ba3f86204ae3ab997432c26b0eea6b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 7 17:23:52 2012 +0000
put .ui translations into the langpacks
and drop .ui suffix from the translation files
Change-Id: I01e0e2f17c97584230b8da4ee0dd08a0444d77fd
diff --git a/postprocess/packconfig/makefile.mk b/postprocess/packconfig/makefile.mk
index b1d8998..e54b4bb 100644
--- a/postprocess/packconfig/makefile.mk
+++ b/postprocess/packconfig/makefile.mk
@@ -29,5 +29,5 @@ TARGET=uiconfig
ALLTAR : $(BIN)$/uiconfig.zip
$(BIN)$/uiconfig.zip .PHONY:
- $(PERL) packconfig.pl -i $(SOLARXMLDIR)$/uiconfig -o $@
+ $(PERL) packconfig.pl -i $(SOLARXMLDIR)$/uiconfig -o $(BIN)$/
diff --git a/postprocess/packconfig/packconfig.pl b/postprocess/packconfig/packconfig.pl
index 59a69ad..ec59dce 100644
--- a/postprocess/packconfig/packconfig.pl
+++ b/postprocess/packconfig/packconfig.pl
@@ -27,6 +27,7 @@ use strict;
use Getopt::Long;
use File::Find;
use File::Basename;
+use File::Spec;
use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
#### globals ####
@@ -35,6 +36,7 @@ my $out_path; # path to output archives in
my $files_path; # path to look for desired files
my $verbose; # be verbose
my $extra_verbose; # be extra verbose
+my $current_lang; # big fat global because File::Find is a pig
#### script id #####
@@ -43,10 +45,23 @@ my $extra_verbose; # be extra verbose
#### main #####
parse_options();
+
+#pack the .ui translations
+my @langs = split(/\s+/, $ENV{WITH_LANG});
+foreach (@langs) {
+ next if ($_ eq "en-US");
+ my %files_hash;
+ my $file_ref = get_lang_files(\%files_hash, $_);
+ my $out_file="$out_path"."uiconfig_".$_.".zip";
+ packzip(\%files_hash, $out_file);
+}
+
+#pack the core files
my %files_hash;
my $file_ref = get_core_files(\%files_hash);
my $out_file="$out_path"."uiconfig.zip";
packzip(\%files_hash, $out_file);
+
exit(0);
#### subroutines ####
@@ -108,8 +123,8 @@ sub get_core_files
my $files_hash_ref = shift;
find_core_files($files_hash_ref);
- if ( !keys %files_hash ) {
- print_error("can't find any image lists in '$files_path'", 3);
+ if ( !keys $files_hash_ref ) {
+ print_error("can't find any config files in '$files_path'", 3);
}
return wantarray ? @main::file_list : \@main::file_list;
@@ -118,14 +133,40 @@ sub get_core_files
sub find_core_files
{
my $files_hash_ref = shift;
- find({ wanted => \&wanted, no_chdir => 0 }, "$files_path");
+ find({ wanted => \&wanted_core, no_chdir => 0 }, "$files_path");
+ foreach ( @main::file_list ) {
+ /^\Q$files_path\E\/(.*)$/o;
+ $files_hash_ref->{$1}++;
+ }
+}
+
+sub get_lang_files
+{
+ local @main::file_list;
+
+ my $files_hash_ref = shift;
+ my $lang = shift;
+ find_lang_files($files_hash_ref, $lang);
+
+ if ( !keys $files_hash_ref ) {
+ print_error("can't find any config files in '$files_path'", 3);
+ }
+
+ return wantarray ? @main::file_list : \@main::file_list;
+}
+
+sub find_lang_files
+{
+ my $files_hash_ref = shift;
+ $current_lang = shift;
+ find({ wanted => \&wanted_lang, no_chdir => 0 }, "$files_path");
foreach ( @main::file_list ) {
/^\Q$files_path\E\/(.*)$/o;
$files_hash_ref->{$1}++;
}
}
-sub wanted
+sub wanted_core
{
my $file = $_;
@@ -134,6 +175,17 @@ sub wanted
}
}
+sub wanted_lang
+{
+ my $file = $_;
+
+ my @dirs = File::Spec->splitdir($File::Find::dir);
+
+ if ($dirs[-1] eq $current_lang) {
+ push @main::file_list, $File::Find::name;
+ }
+}
+
sub is_file_newer
{
my $test_hash_ref = shift;
diff --git a/postprocess/prj/d.lst b/postprocess/prj/d.lst
index f6be8cf..123f945 100644
--- a/postprocess/prj/d.lst
+++ b/postprocess/prj/d.lst
@@ -1,5 +1,5 @@
mkdir: %_DEST%\xml\ooo
-..\%__SRC%\bin\uiconfig.zip %_DEST%\bin\uiconfig.zip
+..\%__SRC%\bin\uiconfig*.zip %_DEST%\bin\
..\%__SRC%\misc\*.xcd %_DEST%\xml\
..\%__SRC%\misc\lang\*.xcd %_DEST%\xml\
..\%__SRC%\misc\scriptproviderforbeanshell.rdb %_DEST%\xml\scriptproviderforbeanshell.rdb
diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp
index 36ca6d2..eaf9294 100644
--- a/scp2/source/ooo/file_ooo.scp
+++ b/scp2/source/ooo/file_ooo.scp
@@ -738,7 +738,7 @@ End
#endif
#endif
-// new user interface configuration files
+// user interface configuration files
File gid_File_Share_Config_Sofficecfg_uiconfig_Zip
TXT_FILE_BODY;
Styles = (ARCHIVE);
@@ -747,6 +747,14 @@ File gid_File_Share_Config_Sofficecfg_uiconfig_Zip
Patchfiles = ();
End
+// user interface configuration file translations
+File gid_File_Share_Config_Sofficecfg_uiconfig_Zip_Lang
+ TXT_FILE_BODY;
+ Styles = (ARCHIVE);
+ Dir = gid_Dir_Share_Config_Sofficecfg;
+ EXTRA_ALL_LANG_BUT_EN_US(uiconfig,zip);
+End
+
#ifdef WNT
STD_SHELLNEW_FILE(gid_File_Shellnew_Ods_Soffice, soffice.ods)
diff --git a/scp2/source/ooo/module_lang_template.scp b/scp2/source/ooo/module_lang_template.scp
index 213b00e..9a85f88 100644
--- a/scp2/source/ooo/module_lang_template.scp
+++ b/scp2/source/ooo/module_lang_template.scp
@@ -30,7 +30,8 @@ Module gid_Module_Langpack_Basis_Template
Name = "gid_Module_Langpack_Root_Template";
Description = "gid_Module_Langpack_Root_Template";
Styles = (TEMPLATEMODULE);
- Files = (gid_File_Extra_Autotextshare_Lang,
+ Files = (gid_File_Share_Config_Sofficecfg_uiconfig_Zip_Lang,
+ gid_File_Extra_Autotextshare_Lang,
gid_File_Registry_Filter_Zip,
gid_File_Registry_Lang,
gid_File_Registry_Spool_Langpack_Lang,
diff --git a/solenv/gbuild/UI.mk b/solenv/gbuild/UI.mk
index 2c6435e..18978ce 100644
--- a/solenv/gbuild/UI.mk
+++ b/solenv/gbuild/UI.mk
@@ -156,7 +156,7 @@ $$(eval $$(call gb_Module_register_target,$(call gb_UI_get_target,$(1)),$(call g
endef
# gb_UI__get_outdir_filename target file lang?
-gb_UI__get_outdir_filename = xml/uiconfig/$(1)/ui/$(if $(3),res/$(3)/)$(notdir $(2)).ui
+gb_UI__get_outdir_filename = xml/uiconfig/$(1)/ui/$(if $(3),res/$(3)/)$(notdir $(2))$(if $(3),,.ui)
# gb_UI__add_uifile target package destfile srcfile lang?
define gb_UI__package_uifile
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index b3a0e13..27e6db9 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -116,6 +116,7 @@ private:
std::set<Window*> m_aRedundantParentWidgets;
};
+ void loadTranslations(const com::sun::star::lang::Locale &rLocale, const OUString &rUri);
OString getTranslation(const OString &rId, const OString &rProperty) const;
OString m_sID;
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index dcef331..3e0fe34 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -73,44 +73,32 @@ namespace
}
}
-VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OString sID)
- : m_sID(sID)
- , m_sHelpRoot(OUStringToOString(sUIFile, RTL_TEXTENCODING_UTF8))
- , m_sProductName(OUStringToOString(utl::ConfigManager::getProductName(), RTL_TEXTENCODING_UTF8))
- , m_pParent(pParent)
- , m_pParserState(new ParserState)
+void VclBuilder::loadTranslations(const com::sun::star::lang::Locale &rLocale, const OUString& rUri)
{
- m_bToplevelHasDeferredInit = (pParent && pParent->IsDialog()) ? ((Dialog*)pParent)->isDeferredInit() : false;
-
- sal_Int32 nIdx = m_sHelpRoot.lastIndexOf('.');
- if (nIdx != -1)
- m_sHelpRoot = m_sHelpRoot.copy(0, nIdx);
- m_sHelpRoot = m_sHelpRoot + OString('/');
-
- OUString sUri = sUIDir + sUIFile;
-
- ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
- for (int i = aLocale.Country.isEmpty() ? 1 : 0; i < 2; ++i)
+ for (int i = rLocale.Country.isEmpty() ? 1 : 0; i < 2; ++i)
{
OUStringBuffer aTransBuf;
- sal_Int32 nLastSlash = sUri.lastIndexOf('/');
+ sal_Int32 nLastSlash = rUri.lastIndexOf('/');
if (nLastSlash != -1)
- aTransBuf.append(sUri.copy(0, nLastSlash));
+ aTransBuf.append(rUri.copy(0, nLastSlash));
else
{
aTransBuf.append('.');
nLastSlash = 0;
}
- aTransBuf.append("/res/").append(aLocale.Language);
+ aTransBuf.append("/res/").append(rLocale.Language);
switch (i)
{
case 0:
- aTransBuf.append('-').append(aLocale.Country);
+ aTransBuf.append('-').append(rLocale.Country);
break;
default:
break;
}
- aTransBuf.append(sUri.copy(nLastSlash));
+ sal_Int32 nEndName = rUri.lastIndexOf('.');
+ if (nEndName == -1)
+ nEndName = rUri.getLength();
+ aTransBuf.append(rUri.copy(nLastSlash, nEndName-nLastSlash));
OUString sTransUri = aTransBuf.makeStringAndClear();
try
@@ -122,6 +110,28 @@ VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OStri
{
}
}
+}
+
+VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OString sID)
+ : m_sID(sID)
+ , m_sHelpRoot(OUStringToOString(sUIFile, RTL_TEXTENCODING_UTF8))
+ , m_sProductName(OUStringToOString(utl::ConfigManager::getProductName(), RTL_TEXTENCODING_UTF8))
+ , m_pParent(pParent)
+ , m_pParserState(new ParserState)
+{
+ m_bToplevelHasDeferredInit = (pParent && pParent->IsDialog()) ? ((Dialog*)pParent)->isDeferredInit() : false;
+
+ sal_Int32 nIdx = m_sHelpRoot.lastIndexOf('.');
+ if (nIdx != -1)
+ m_sHelpRoot = m_sHelpRoot.copy(0, nIdx);
+ m_sHelpRoot = m_sHelpRoot + OString('/');
+
+ OUString sUri = sUIDir + sUIFile;
+
+ com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
+ bool bEN_US = aLocale.Language == "en" && aLocale.Country == "US" && aLocale.Variant.isEmpty();
+ if (!bEN_US)
+ loadTranslations(aLocale, sUri);
xmlreader::XmlReader reader(sUri);
commit 144fbefbf858ab6a680437fa69f406967b6ae9e3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 7 15:12:17 2012 +0000
refactor packconfig to hopefully be unchanged, but extendable
Change-Id: I25fe2f7e3277bd9a9509b0bec81f8d76b2bf8c8f
diff --git a/postprocess/packconfig/packconfig.pl b/postprocess/packconfig/packconfig.pl
index cb8fb89..59a69ad 100644
--- a/postprocess/packconfig/packconfig.pl
+++ b/postprocess/packconfig/packconfig.pl
@@ -31,12 +31,10 @@ use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
#### globals ####
-my $out_file; # path to output archive
-my $tmp_out_file; # path to temporary output file
+my $out_path; # path to output archives in
my $files_path; # path to look for desired files
my $verbose; # be verbose
my $extra_verbose; # be extra verbose
-my $do_rebuild = 0; # is rebuilding zipfile required?
#### script id #####
@@ -46,21 +44,37 @@ my $do_rebuild = 0; # is rebuilding zipfile required?
parse_options();
my %files_hash;
-my $file_ref = get_files();
+my $file_ref = get_core_files(\%files_hash);
+my $out_file="$out_path"."uiconfig.zip";
+packzip(\%files_hash, $out_file);
+exit(0);
-$do_rebuild = is_file_newer(\%files_hash) if $do_rebuild == 0;
+#### subroutines ####
-if ( $do_rebuild == 1 ) {
- create_zip_archive(\%files_hash);
- replace_file($tmp_out_file, $out_file);
- print_message("packing $out_file finished.");
-} else {
- print_message("$out_file up to date. nothing to do.");
-}
+sub packzip
+{
+ my $file_hash_ref = shift;
+ my $output_file = shift;
-exit(0);
+ # Check if output_file can be written.
+ my $out_dir = dirname($output_file);
+ print_error("no such directory: '$out_dir'", 2) if ! -d $out_dir;
+ print_error("can't search directory: '$out_dir'", 2) if ! -x $out_dir;
+ print_error("directory is not writable: '$out_dir'", 2) if ! -w $out_dir;
-#### subroutines ####
+ # is rebuilding zipfile required?
+ my $do_rebuild = is_file_newer($file_hash_ref, $output_file);
+
+ if ( $do_rebuild == 1 ) {
+ #temporary intermediate output file
+ my $tmp_out_file="$output_file"."$$".$ENV{INPATH};
+ create_zip_archive($file_hash_ref, $tmp_out_file);
+ replace_file($tmp_out_file, $output_file);
+ print_message("packing $output_file finished.");
+ } else {
+ print_message("$output_file up to date. nothing to do.");
+ }
+}
sub parse_options
{
@@ -68,28 +82,18 @@ sub parse_options
my $p = Getopt::Long::Parser->new();
my $success =$p->getoptions(
'-h' => \$opt_help,
- '-o=s' => \$out_file,
+ '-o=s' => \$out_path,
'-i=s' => \$files_path,
'-v' => \$verbose,
'-vv' => \$extra_verbose
);
- if ( $opt_help || !$success || !$out_file || !$files_path )
+ if ( $opt_help || !$success || !$out_path || !$files_path )
{
usage();
exit(1);
}
- #define intermediate output file
- $tmp_out_file="$out_file"."$$".$ENV{INPATH};
- # Sanity checks.
-
- # Check if out_file can be written.
- my $out_dir = dirname($out_file);
- print_error("no such directory: '$out_dir'", 2) if ! -d $out_dir;
- print_error("can't search directory: '$out_dir'", 2) if ! -x $out_dir;
- print_error("directory is not writable: '$out_dir'", 2) if ! -w $out_dir;
-
# Check paths.
foreach ($files_path) {
print_error("no such directory: '$_'", 2) if ! -d $_;
@@ -97,11 +101,12 @@ sub parse_options
}
}
-sub get_files
+sub get_core_files
{
local @main::file_list;
- find_files(\%files_hash);
+ my $files_hash_ref = shift;
+ find_core_files($files_hash_ref);
if ( !keys %files_hash ) {
print_error("can't find any image lists in '$files_path'", 3);
@@ -110,7 +115,7 @@ sub get_files
return wantarray ? @main::file_list : \@main::file_list;
}
-sub find_files
+sub find_core_files
{
my $files_hash_ref = shift;
find({ wanted => \&wanted, no_chdir => 0 }, "$files_path");
@@ -132,12 +137,13 @@ sub wanted
sub is_file_newer
{
my $test_hash_ref = shift;
+ my $zip_file = shift;
my $reference_stamp = 0;
- print_message("checking timestamps ...") if $verbose;
- if ( -e $out_file ) {
- $reference_stamp = (stat($out_file))[9];
- print_message("found $out_file with $reference_stamp ...") if $verbose;
+ print_message("checking timestamps for $zip_file ...") if $verbose;
+ if ( -e $zip_file ) {
+ $reference_stamp = (stat($zip_file))[9];
+ print_message("found $zip_file with $reference_stamp ...") if $verbose;
}
return 1 if $reference_stamp == 0;
@@ -155,6 +161,7 @@ sub is_file_newer
sub create_zip_archive
{
my $zip_hash_ref = shift;
+ my $zip_output_file = shift;
print_message("creating config archive ...") if $verbose;
my $zip = Archive::Zip->new();
@@ -173,9 +180,9 @@ sub create_zip_archive
print_error("can't add file '$path' to config zip archive: $!", 5);
}
}
- my $status = $zip->writeToFileNamed($tmp_out_file);
+ my $status = $zip->writeToFileNamed($zip_output_file);
if ( $status != AZ_OK ) {
- print_error("write image zip archive '$tmp_out_file' failed. Reason: $status", 6);
+ print_error("write image zip archive '$zip_output_file' failed. Reason: $status", 6);
}
return;
}
@@ -235,7 +242,7 @@ sub usage
print STDERR "Creates archive of userinterface config files\n";
print STDERR "Options:\n";
print STDERR " -h print this help\n";
- print STDERR " -o out_file path to output archive\n";
+ print STDERR " -o out_path path to output archive\n";
print STDERR " -i file_path path to directory containing the config files\n";
print STDERR " -v verbose\n";
print STDERR " -vv very verbose\n";
More information about the Libreoffice-commits
mailing list