summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-18 11:27:28 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-18 15:55:00 +0900
commite1b653b17387b02624badcd1fb11c38ccf846c9e (patch)
tree2cf362fa330f7841c9cf61cc57c7664eb6ce05c1 /filter
parentperform a boundary check (diff)
downloadcore-e1b653b17387b02624badcd1fb11c38ccf846c9e.tar.gz
core-e1b653b17387b02624badcd1fb11c38ccf846c9e.zip
cleanup XMLFilterSettingsDialog
Change-Id: I5e42afe348004daa99c0d3b331bb1fe0f84bd309
Diffstat (limited to 'filter')
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx105
1 files changed, 17 insertions, 88 deletions
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 0503da5d0244..b1004ec856f3 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -57,7 +57,7 @@ using namespace com::sun::star::util;
using ::rtl::Uri;
XMLFilterSettingsDialog::XMLFilterSettingsDialog(vcl::Window* pParent,
- const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const css::uno::Reference<css::uno::XComponentContext>& rxContext,
Dialog::InitFlag eFlag)
: ModelessDialog(pParent, "XMLFilterSettingsDialog", "filter/ui/xmlfiltersettings.ui", eFlag)
, mxContext( rxContext )
@@ -161,25 +161,18 @@ IMPL_LINK(XMLFilterSettingsDialog, ClickHdl_Impl, PushButton *, pButton )
return 0;
}
-
-
IMPL_LINK_NOARG(XMLFilterSettingsDialog, SelectionChangedHdl_Impl)
{
updateStates();
return 0;
}
-
-
IMPL_LINK_NOARG(XMLFilterSettingsDialog, DoubleClickHdl_Impl)
{
onEdit();
return 0;
}
-
-
-
short XMLFilterSettingsDialog::Execute()
{
m_pCtrlFilterList->GrabFocus();
@@ -191,8 +184,6 @@ short XMLFilterSettingsDialog::Execute()
return ModelessDialog::Execute();
}
-
-
void XMLFilterSettingsDialog::updateStates()
{
SvTreeListEntry* pSelectedEntry = m_pFilterListBox->FirstSelected();
@@ -223,8 +214,6 @@ void XMLFilterSettingsDialog::updateStates()
m_pPBSave->Enable( bHasSelection );
}
-
-
/** is called when the user clicks on the "New" button */
void XMLFilterSettingsDialog::onNew()
{
@@ -252,8 +241,6 @@ void XMLFilterSettingsDialog::onNew()
}
}
-
-
/** is called when the user clicks on the "Edit" Button */
void XMLFilterSettingsDialog::onEdit()
{
@@ -279,8 +266,6 @@ void XMLFilterSettingsDialog::onEdit()
}
}
-
-
/** helper to create a sequence of strings from an extensions strings
"ext1;ext2;ext3" will become { "ext1", "ext2", "ext3" } */
static Sequence< OUString > createExtensionsSequence( const OUString& rExtensions )
@@ -332,8 +317,6 @@ static Sequence< OUString > createExtensionsSequence( const OUString& rExtension
return aExtensions;
}
-
-
/** checks if the given name is unique inside the filter factory. If not,
numbers are added until the returned name is unique */
OUString XMLFilterSettingsDialog::createUniqueFilterName( const OUString& rFilterName )
@@ -353,8 +336,6 @@ OUString XMLFilterSettingsDialog::createUniqueFilterName( const OUString& rFilte
return aFilterName;
}
-
-
/** checks if the given name is unique inside the type detection. If not,
numbers are added until the returned name is unique */
OUString XMLFilterSettingsDialog::createUniqueTypeName( const OUString& rTypeName )
@@ -434,8 +415,6 @@ OUString XMLFilterSettingsDialog::createUniqueInterfaceName( const OUString& rIn
return aInterfaceName;
}
-
-
/** inserts a new filter into the ui and configuration if pOldInfo is NULL.
If pOldInfo is not null, the old filter will be replaced with the new settings */
bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const filter_info_impl* pOldInfo )
@@ -779,8 +758,6 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi
return bOk;
}
-
-
/** is called when the user clicks the "Test" button */
void XMLFilterSettingsDialog::onTest()
{
@@ -795,8 +772,6 @@ void XMLFilterSettingsDialog::onTest()
}
}
-
-
void XMLFilterSettingsDialog::onDelete()
{
SvTreeListEntry* pEntry = m_pFilterListBox->FirstSelected();
@@ -887,8 +862,6 @@ void XMLFilterSettingsDialog::onDelete()
updateStates();
}
-
-
void XMLFilterSettingsDialog::onSave()
{
XMLFilterVector aFilters;
@@ -943,8 +916,6 @@ void XMLFilterSettingsDialog::onSave()
}
}
-
-
void XMLFilterSettingsDialog::onOpen()
{
XMLFilterVector aFilters;
@@ -1009,8 +980,6 @@ void XMLFilterSettingsDialog::onOpen()
}
}
-
-
void XMLFilterSettingsDialog::onClose()
{
Close();
@@ -1040,8 +1009,6 @@ bool XMLFilterSettingsDialog::Notify( NotifyEvent& rNEvt )
return nRet;
}
-
-
void XMLFilterSettingsDialog::disposeFilterList()
{
std::vector< filter_info_impl* >::iterator aIter( maFilterVector.begin() );
@@ -1054,8 +1021,6 @@ void XMLFilterSettingsDialog::disposeFilterList()
m_pFilterListBox->Clear();
}
-
-
void XMLFilterSettingsDialog::initFilterList()
{
if( mxFilterContainer.is() )
@@ -1236,10 +1201,6 @@ void XMLFilterSettingsDialog::initFilterList()
m_pFilterListBox->Select( pEntry );
}
-
-
-
-
application_info_impl::application_info_impl( const sal_Char * pDocumentService, ResId& rUINameRes, const sal_Char * mpXMLImporter, const sal_Char * mpXMLExporter )
: maDocumentService( pDocumentService, strlen( pDocumentService ), RTL_TEXTENCODING_ASCII_US ),
maDocumentUIName( OUString( rUINameRes ) ),
@@ -1248,8 +1209,6 @@ application_info_impl::application_info_impl( const sal_Char * pDocumentService,
{
}
-
-
std::vector< application_info_impl* >& getApplicationInfos()
{
static std::vector< application_info_impl* > aInfos;
@@ -1317,8 +1276,6 @@ std::vector< application_info_impl* >& getApplicationInfos()
return aInfos;
}
-
-
const application_info_impl* getApplicationInfo( const OUString& rServiceName )
{
std::vector< application_info_impl* >& rInfos = getApplicationInfos();
@@ -1334,8 +1291,6 @@ const application_info_impl* getApplicationInfo( const OUString& rServiceName )
return NULL;
}
-
-
OUString getApplicationUIName( const OUString& rServiceName )
{
const application_info_impl* pInfo = getApplicationInfo( rServiceName );
@@ -1491,8 +1446,6 @@ IMPL_LINK( XMLFilterListBox, TabBoxScrollHdl_Impl, SvTabListBox*, /* pList */ )
return 0;
}
-
-
IMPL_LINK( XMLFilterListBox, HeaderEndDrag_Impl, HeaderBar*, pBar )
{
if ( pBar && !pBar->GetCurItemId() )
@@ -1522,8 +1475,6 @@ IMPL_LINK( XMLFilterListBox, HeaderEndDrag_Impl, HeaderBar*, pBar )
return 1;
}
-
-
/** adds a new filter info entry to the ui filter list */
void XMLFilterListBox::addFilterEntry( const filter_info_impl* pInfo )
{
@@ -1531,8 +1482,6 @@ void XMLFilterListBox::addFilterEntry( const filter_info_impl* pInfo )
InsertEntryToColumn( aEntryStr, TREELIST_APPEND, 0xffff, (void*)pInfo );
}
-
-
void XMLFilterListBox::changeEntry( const filter_info_impl* pInfo )
{
const sal_uLong nCount = GetEntryCount();
@@ -1549,8 +1498,6 @@ void XMLFilterListBox::changeEntry( const filter_info_impl* pInfo )
}
}
-
-
OUString XMLFilterListBox::getEntryString( const filter_info_impl* pInfo )
{
OUString aEntryStr( pInfo->maFilterName + "\t");
@@ -1583,21 +1530,15 @@ OUString XMLFilterListBox::getEntryString( const filter_info_impl* pInfo )
return aEntryStr;
}
-
-
-
-
filter_info_impl::filter_info_impl()
-: maFlags(0x00080040),
- maFileFormatVersion(0),
- mnDocumentIconID(0),
- mbReadonly(false),
- mbNeedsXSLT2(false)
+ : maFlags(0x00080040)
+ , maFileFormatVersion(0)
+ , mnDocumentIconID(0)
+ , mbReadonly(false)
+ , mbNeedsXSLT2(false)
{
}
-
-
filter_info_impl::filter_info_impl( const filter_info_impl& rInfo ) :
maFilterName( rInfo.maFilterName ),
maType( rInfo.maType ),
@@ -1620,8 +1561,6 @@ filter_info_impl::filter_info_impl( const filter_info_impl& rInfo ) :
{
}
-
-
bool filter_info_impl::operator==( const filter_info_impl& r ) const
{
return maFilterName == r.maFilterName &&
@@ -1659,43 +1598,35 @@ Sequence< OUString > filter_info_impl::getFilterUserData() const
return aUserData;
}
-
-
-
OUString string_encode( const OUString & rText )
{
- static sal_Bool const aCharClass[]
- = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* UricNoSlash */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, /* !"#$%&'()*+,-./*/
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, /*0123456789:;<=>?*/
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*@ABCDEFGHIJKLMNO*/
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /*PQRSTUVWXYZ[\]^_*/
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*`abcdefghijklmno*/
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0 /*pqrstuvwxyz{|}~ */
- };
+ static sal_Bool const aCharClass[] =
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* UricNoSlash */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, /* !"#$%&'()*+,-./*/
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, /*0123456789:;<=>?*/
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*@ABCDEFGHIJKLMNO*/
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /*PQRSTUVWXYZ[\]^_*/
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*`abcdefghijklmno*/
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0 /*pqrstuvwxyz{|}~ */
+ };
return Uri::encode( rText, aCharClass, rtl_UriEncodeCheckEscapes, RTL_TEXTENCODING_UTF8 );
}
-
-
OUString string_decode( const OUString & rText )
{
return Uri::decode( rText, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
}
-
-
bool isFileURL( const OUString & rURL )
{
return rURL.startsWith("file:");
}
-
-
bool copyStreams( Reference< XInputStream > xIS, Reference< XOutputStream > xOS )
{
try
@@ -1733,8 +1664,6 @@ bool copyStreams( Reference< XInputStream > xIS, Reference< XOutputStream > xOS
return false;
}
-
-
bool createDirectory( OUString& rURL )
{
sal_Int32 nLastIndex = sizeof( "file:///" ) - 2;