diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-03-27 20:08:50 +0100 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-03-27 20:09:31 +0100 |
commit | 8e26b4783f1f47ff5d489e7df5869240eefd1071 (patch) | |
tree | 80c4c9899fb3b05fcadc845444b06e1e3221e1c2 /l10ntools/source/merge.cxx | |
parent | 239fb4cb41cb0d1ed42bf5cf8ecdabdca4a28a68 (diff) |
Refactor l10ntools
Delete unused functions.
Make Export class more encapsulated.
Move to local that functions which are used only in one file.
Common contans method which are used by all executables.
Helper contains methods belong to xml parsing.
Change-Id: I28773a2c7eea90da7df7f32720fd38de2cb661ac
Diffstat (limited to 'l10ntools/source/merge.cxx')
-rw-r--r-- | l10ntools/source/merge.cxx | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 34f590c4bccf..46c7828d969c 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -60,6 +60,108 @@ namespace } // +// class ResData +// + +ResData::ResData(const rtl::OString &rPF, const rtl::OString &rGId) + : + nWidth( 0 ), + nChildIndex( 0 ), + nIdLevel( ID_LEVEL_NULL ), + bChild( sal_False ), + bChildWithText( sal_False ), + bText( sal_False ), + bHelpText( sal_False ), + bQuickHelpText( sal_False ), + bTitle( sal_False ), + bList( sal_False ), + bRestMerged( sal_False ), + sGId( rGId ), + nTextRefId( REFID_NONE ), + nHelpTextRefId( REFID_NONE ), + nQuickHelpTextRefId( REFID_NONE ), + nTitleRefId( REFID_NONE ), + sTextTyp( "Text" ), + pStringList( NULL ), + pUIEntries( NULL ), + pItemList( NULL ), + pFilterList( NULL ), + pPairedList( NULL ), + sPForm( rPF ) +{ + sGId = sGId.replaceAll("\r", rtl::OString()); + sPForm = sPForm.replaceAll("\r", rtl::OString()); +} + +ResData::ResData(const rtl::OString &rPF, const rtl::OString &rGId , const rtl::OString &rFilename) + : + nWidth( 0 ), + nChildIndex( 0 ), + nIdLevel( ID_LEVEL_NULL ), + bChild( sal_False ), + bChildWithText( sal_False ), + bText( sal_False ), + bHelpText( sal_False ), + bQuickHelpText( sal_False ), + bTitle( sal_False ), + bList( sal_False ), + bRestMerged( sal_False ), + sGId( rGId ), + sFilename( rFilename ), + nTextRefId( REFID_NONE ), + nHelpTextRefId( REFID_NONE ), + nQuickHelpTextRefId( REFID_NONE ), + nTitleRefId( REFID_NONE ), + sTextTyp( "Text" ), + pStringList( NULL ), + pUIEntries( NULL ), + pItemList( NULL ), + pFilterList( NULL ), + pPairedList( NULL ), + sPForm( rPF ) +{ + sGId = sGId.replaceAll("\r", rtl::OString()); + sPForm = sPForm.replaceAll("\r", rtl::OString()); +} + + +ResData::~ResData() +{ + if ( pStringList ) { + // delete existing res. of type StringList + for ( size_t i = 0; i < pStringList->size(); i++ ) { + ExportListEntry* test = (*pStringList)[ i ]; + if( test != NULL ) delete test; + } + delete pStringList; + } + if ( pFilterList ) { + // delete existing res. of type FilterList + for ( size_t i = 0; i < pFilterList->size(); i++ ) { + ExportListEntry* test = (*pFilterList)[ i ]; + delete test; + } + delete pFilterList; + } + if ( pItemList ) { + // delete existing res. of type ItemList + for ( size_t i = 0; i < pItemList->size(); i++ ) { + ExportListEntry* test = (*pItemList)[ i ]; + delete test; + } + delete pItemList; + } + if ( pUIEntries ) { + // delete existing res. of type UIEntries + for ( size_t i = 0; i < pUIEntries->size(); i++ ) { + ExportListEntry* test = (*pUIEntries)[ i ]; + delete test; + } + delete pUIEntries; + } +} + +// // class PFormEntrys // |