diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2019-02-15 13:27:45 +0100 |
---|---|---|
committer | Xisco FaulĂ <xiscofauli@libreoffice.org> | 2019-03-12 11:21:57 +0100 |
commit | 2f7c3cce2699901c0ffe3780cfad0376a5d1a519 (patch) | |
tree | f62c3707e5e14209581f63ac05c32ca641814820 /wizards/com/sun/star/wizards/common | |
parent | 00a86e8be983f7a92723dfe6cf5986974d77644e (diff) |
Remove unused python code
This code was automatically converted from Java to Python.
It might be used at some point if the remaining java wizards
are converted to python, however that's not the case as
per today, thus this code is unused.
Let's get rid of it as it might create confusion
Change-Id: Ic58ade24b10f7a0654b3e8ae39f6afa712589c3d
Reviewed-on: https://gerrit.libreoffice.org/67868
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
Diffstat (limited to 'wizards/com/sun/star/wizards/common')
-rw-r--r-- | wizards/com/sun/star/wizards/common/Desktop.py | 40 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/common/FileAccess.py | 29 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/common/NumberFormatter.py | 161 |
3 files changed, 0 insertions, 230 deletions
diff --git a/wizards/com/sun/star/wizards/common/Desktop.py b/wizards/com/sun/star/wizards/common/Desktop.py index 94a4a111f276..2715ffb75274 100644 --- a/wizards/com/sun/star/wizards/common/Desktop.py +++ b/wizards/com/sun/star/wizards/common/Desktop.py @@ -84,33 +84,6 @@ class Desktop(object): return sIncSuffix - @classmethod - def checkforfirstSpecialCharacter(self, _xMSF, _sString, _aLocale): - try: - nStartFlags = ANY_LETTER_OR_NUMBER + ASC_UNDERSCORE - ocharservice = _xMSF.createInstance( - "com.sun.star.i18n.CharacterClassification") - aResult = ocharservice.parsePredefinedToken(KParseType.IDENTNAME, - _sString, 0, _aLocale, nStartFlags, "", nStartFlags, " ") - return aResult.EndPos - except Exception: - traceback.print_exc() - return -1 - - @classmethod - def removeSpecialCharacters(self, _xMSF, _aLocale, _sname): - snewname = _sname - i = 0 - while i < snewname.length(): - i = Desktop.checkforfirstSpecialCharacter(_xMSF, snewname, - _aLocale) - if i < snewname.length(): - sspecialchar = snewname.substring(i, i + 1) - snewname = JavaTools.replaceSubString(snewname, "", - sspecialchar) - - return snewname - ''' Checks if the passed Element Name already exists in the ElementContainer. If yes it appends a suffix to make it unique @@ -124,16 +97,3 @@ class Desktop(object): sIncSuffix = self.getIncrementSuffix(xElementContainer, sElementName) return sElementName + sIncSuffix - @classmethod - def getDispatchURL(self, xMSF, _sURL): - try: - oTransformer = xMSF.createInstance("com.sun.star.util.URLTransformer") - oURL = URL() - oURL.Complete = _sURL - ok, oURL = oTransformer.parseStrict(oURL) - if (not ok): - return None - return oURL - except Exception: - traceback.print_exc() - return None diff --git a/wizards/com/sun/star/wizards/common/FileAccess.py b/wizards/com/sun/star/wizards/common/FileAccess.py index b05fcb2c4b21..2740b7aa3c3e 100644 --- a/wizards/com/sun/star/wizards/common/FileAccess.py +++ b/wizards/com/sun/star/wizards/common/FileAccess.py @@ -70,24 +70,6 @@ class FileAccess(object): return "" @classmethod - def combinePaths(self, xMSF, _sFirstPath, _sSecondPath): - bexists = False - ReturnPath = "" - try: - xUcbInterface = xMSF.createInstance( - "com.sun.star.ucb.SimpleFileAccess") - ReturnPath = _sFirstPath + _sSecondPath - bexists = xUcbInterface.exists(ReturnPath) - except Exception: - traceback.print_exc() - return "" - - if not bexists: - raise NoValidPathException (xMSF, "") - - return ReturnPath - - @classmethod def getFolderTitles(self, xMSF, FilterName, FolderName, resDict=None): #Returns and ordered dict containing the template's name and path @@ -132,17 +114,6 @@ class FileAccess(object): return locLayoutFiles @classmethod - def addPath(self, _sPath, _sPath2): - if not _sPath.endsWith("/"): - _sPath += "/" - - if _sPath2.startsWith("/"): - _sPath2 = _sPath2.substring(1) - - sNewPath = _sPath + _sPath2 - return sNewPath - - @classmethod def getTitle(self, xMSF, _sFile): sTitle = "" try: diff --git a/wizards/com/sun/star/wizards/common/NumberFormatter.py b/wizards/com/sun/star/wizards/common/NumberFormatter.py index 9cb1763c8db1..54d84c9fc709 100644 --- a/wizards/com/sun/star/wizards/common/NumberFormatter.py +++ b/wizards/com/sun/star/wizards/common/NumberFormatter.py @@ -84,164 +84,3 @@ class NumberFormatter(object): def convertStringToNumber(self, _nkey, _sString): return self.xNumberFormatter.convertStringToNumber(_nkey, _sString) - ''' - @param dateCorrection The lDateCorrection to set. - ''' - - def setNullDateCorrection(self, dateCorrection): - self.lDateCorrection = dateCorrection - - def defineNumberFormat(self, _FormatString): - try: - NewFormatKey = self.xNumberFormats.queryKey( - _FormatString, self.aLocale, True) - if NewFormatKey is -1: - NewFormatKey = self.xNumberFormats.addNew( - _FormatString, self.aLocale) - - return NewFormatKey - except Exception: - traceback.print_exc() - return -1 - - ''' - returns a numberformat for a FormatString. - @param _FormatString - @param _aLocale - @return - ''' - - def defineNumberFormat(self, _FormatString, _aLocale): - try: - NewFormatKey = self.xNumberFormats.queryKey( - _FormatString, _aLocale, True) - if NewFormatKey == -1: - NewFormatKey = self.xNumberFormats.addNew( - _FormatString, _aLocale) - - return NewFormatKey - except Exception: - traceback.print_exc() - return -1 - - def setNumberFormat(self, _xFormatObject, _FormatKey, _oNumberFormatter): - try: - xNumberFormat = _oNumberFormatter.xNumberFormats.getByKey( - _FormatKey) - FormatString = str(Helper.getUnoPropertyValue( - xNumberFormat, "FormatString")) - oLocale = Helper.getUnoPropertyValue(xNumberFormat, "Locale") - NewFormatKey = defineNumberFormat(FormatString, oLocale) - _xFormatObject.setPropertyValue( - "FormatsSupplier", - _oNumberFormatter.xNumberFormatter.getNumberFormatsSupplier()) - if _xFormatObject.getPropertySetInfo().hasPropertyByName( - "NumberFormat"): - _xFormatObject.setPropertyValue("NumberFormat", NewFormatKey) - elif _xFormatObject.getPropertySetInfo().hasPropertyByName( - "FormatKey"): - _xFormatObject.setPropertyValue("FormatKey", NewFormatKey) - else: - # TODO: throws a exception in a try catch environment, very helpful? - raise Exception - - except Exception: - traceback.print_exc() - - def getNullDateCorrection(self): - if not self.bNullDateCorrectionIsDefined: - dNullDate = Helper.getUnoStructValue( - self.xNumberFormatSettings, "NullDate") - lNullDate = Helper.convertUnoDatetoInteger(dNullDate) - oCal = java.util.Calendar.getInstance() - oCal.set(1900, 1, 1) - dTime = oCal.getTime() - lTime = dTime.getTime() - lDBNullDate = lTime / (3600 * 24000) - self.lDateCorrection = lDBNullDate - lNullDate - return self.lDateCorrection - else: - return self.lDateCorrection - - def setBooleanReportDisplayNumberFormat(self): - FormatString = "[=1]" + str(9745) + ";[=0]" + str(58480) + ";0" - self.iLogicalFormatKey = self.xNumberFormats.queryKey( - FormatString, self.aLocale, True) - try: - if self.iLogicalFormatKey == -1: - self.iLogicalFormatKey = self.xNumberFormats.addNew( - FormatString, self.aLocale) - - except Exception: - #MalformedNumberFormat - traceback.print_exc() - self.iLogicalFormatKey = self.xNumberFormats.getStandardFormat( - NumberFormat.LOGICAL, self.aLocale) - - return self.iLogicalFormatKey - - ''' - @return Returns the iDateFormatKey. - ''' - - def getDateFormatKey(self): - if self.iDateFormatKey == -1: - self.iDateFormatKey = self.xNumberFormats.getStandardFormat( - NumberFormat.DATE, self.aLocale) - - return self.iDateFormatKey - - ''' - @return Returns the iDateTimeFormatKey. - ''' - - def getDateTimeFormatKey(self): - if self.iDateTimeFormatKey == -1: - self.iDateTimeFormatKey = self.xNumberFormats.getStandardFormat( - NumberFormat.DATETIME, self.aLocale) - - return self.iDateTimeFormatKey - - ''' - @return Returns the iLogicalFormatKey. - ''' - - def getLogicalFormatKey(self): - if self.iLogicalFormatKey == -1: - self.iLogicalFormatKey = self.xNumberFormats.getStandardFormat( - NumberFormat.LOGICAL, self.aLocale) - - return self.iLogicalFormatKey - - ''' - @return Returns the iNumberFormatKey. - ''' - - def getNumberFormatKey(self): - if self.iNumberFormatKey == -1: - self.iNumberFormatKey = self.xNumberFormats.getStandardFormat( - NumberFormat.NUMBER, self.aLocale) - - return self.iNumberFormatKey - - ''' - @return Returns the iTextFormatKey. - ''' - - def getTextFormatKey(self): - if self.iTextFormatKey == -1: - self.iTextFormatKey = self.xNumberFormats.getStandardFormat( - NumberFormat.TEXT, self.aLocale) - - return self.iTextFormatKey - - ''' - @return Returns the iTimeFormatKey. - ''' - - def getTimeFormatKey(self): - if self.iTimeFormatKey == -1: - self.iTimeFormatKey = self.xNumberFormats.getStandardFormat( - NumberFormat.TIME, self.aLocale) - - return self.iTimeFormatKey |