From 24828f91e22842cdaf64faf7d22a028541e5746c Mon Sep 17 00:00:00 2001 From: Ilmari Lauhakangas Date: Sat, 16 Apr 2022 16:42:40 +0300 Subject: tdf#148621 Improve Basic Help layout - Get rid of tables - Add normalize-whitespace Prism plugin to get rid of useless indents - Fix code blocks poking through sticky header - Add some word wrapping CSS to fix mobile-unfriendliness Change-Id: I73fd1e0678624b0d4bd5561f50e80990db5567be Reviewed-on: https://gerrit.libreoffice.org/c/help/+/133096 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- help3xsl/default.css | 6 + help3xsl/online_transform.xsl | 2 +- help3xsl/prism.css | 2 +- help3xsl/prism.js | 201 ++- source/text/sbasic/shared/03/lib_tools.xhp | 2280 ++++++++++------------------ 5 files changed, 969 insertions(+), 1522 deletions(-) diff --git a/help3xsl/default.css b/help3xsl/default.css index 085d323a95..2c5e59ac0a 100644 --- a/help3xsl/default.css +++ b/help3xsl/default.css @@ -121,6 +121,7 @@ pre, display: inline; padding: 1px 3px; font-family: var(--font_mono); + word-wrap: anywhere; } .smathcode { border-radius: 2px; @@ -178,6 +179,10 @@ pre, .noteicon, .notetext { padding:0.3em; } +/* Override some Prism.js styles */ +code[class*="language-"], pre[class*="language-"] { + white-space: pre-wrap; +} /* Table related classes */ @@ -603,6 +608,7 @@ li.disabled a { background: #18A303; top: 0px; position: sticky; + z-index: 100; } .xapian-omega-search { margin: auto; diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl index 0751d7a862..465415ea24 100644 --- a/help3xsl/online_transform.xsl +++ b/help3xsl/online_transform.xsl @@ -143,8 +143,8 @@ <xsl:value-of disable-output-escaping="yes" select="$titleL10N"/> - + diff --git a/help3xsl/prism.css b/help3xsl/prism.css index f974d0c87c..79d07d18a1 100644 --- a/help3xsl/prism.css +++ b/help3xsl/prism.css @@ -1,5 +1,5 @@ /* PrismJS 1.27.0 -https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+python+visual-basic&plugins=line-numbers */ +https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+python+visual-basic&plugins=line-numbers+normalize-whitespace */ /** * prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML * Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics); diff --git a/help3xsl/prism.js b/help3xsl/prism.js index 546388f444..4e00aeb045 100644 --- a/help3xsl/prism.js +++ b/help3xsl/prism.js @@ -1,5 +1,5 @@ /* PrismJS 1.27.0 -https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+python+visual-basic&plugins=line-numbers */ +https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+python+visual-basic&plugins=line-numbers+normalize-whitespace */ /// var _self = (typeof window !== 'undefined') @@ -2067,3 +2067,202 @@ Prism.languages.vba = Prism.languages['visual-basic']; }()); +(function () { + + if (typeof Prism === 'undefined') { + return; + } + + var assign = Object.assign || function (obj1, obj2) { + for (var name in obj2) { + if (obj2.hasOwnProperty(name)) { + obj1[name] = obj2[name]; + } + } + return obj1; + }; + + function NormalizeWhitespace(defaults) { + this.defaults = assign({}, defaults); + } + + function toCamelCase(value) { + return value.replace(/-(\w)/g, function (match, firstChar) { + return firstChar.toUpperCase(); + }); + } + + function tabLen(str) { + var res = 0; + for (var i = 0; i < str.length; ++i) { + if (str.charCodeAt(i) == '\t'.charCodeAt(0)) { + res += 3; + } + } + return str.length + res; + } + + NormalizeWhitespace.prototype = { + setDefaults: function (defaults) { + this.defaults = assign(this.defaults, defaults); + }, + normalize: function (input, settings) { + settings = assign(this.defaults, settings); + + for (var name in settings) { + var methodName = toCamelCase(name); + if (name !== 'normalize' && methodName !== 'setDefaults' && + settings[name] && this[methodName]) { + input = this[methodName].call(this, input, settings[name]); + } + } + + return input; + }, + + /* + * Normalization methods + */ + leftTrim: function (input) { + return input.replace(/^\s+/, ''); + }, + rightTrim: function (input) { + return input.replace(/\s+$/, ''); + }, + tabsToSpaces: function (input, spaces) { + spaces = spaces|0 || 4; + return input.replace(/\t/g, new Array(++spaces).join(' ')); + }, + spacesToTabs: function (input, spaces) { + spaces = spaces|0 || 4; + return input.replace(RegExp(' {' + spaces + '}', 'g'), '\t'); + }, + removeTrailing: function (input) { + return input.replace(/\s*?$/gm, ''); + }, + // Support for deprecated plugin remove-initial-line-feed + removeInitialLineFeed: function (input) { + return input.replace(/^(?:\r?\n|\r)/, ''); + }, + removeIndent: function (input) { + var indents = input.match(/^[^\S\n\r]*(?=\S)/gm); + + if (!indents || !indents[0].length) { + return input; + } + + indents.sort(function (a, b) { return a.length - b.length; }); + + if (!indents[0].length) { + return input; + } + + return input.replace(RegExp('^' + indents[0], 'gm'), ''); + }, + indent: function (input, tabs) { + return input.replace(/^[^\S\n\r]*(?=\S)/gm, new Array(++tabs).join('\t') + '$&'); + }, + breakLines: function (input, characters) { + characters = (characters === true) ? 80 : characters|0 || 80; + + var lines = input.split('\n'); + for (var i = 0; i < lines.length; ++i) { + if (tabLen(lines[i]) <= characters) { + continue; + } + + var line = lines[i].split(/(\s+)/g); + var len = 0; + + for (var j = 0; j < line.length; ++j) { + var tl = tabLen(line[j]); + len += tl; + if (len > characters) { + line[j] = '\n' + line[j]; + len = tl; + } + } + lines[i] = line.join(''); + } + return lines.join('\n'); + } + }; + + // Support node modules + if (typeof module !== 'undefined' && module.exports) { + module.exports = NormalizeWhitespace; + } + + Prism.plugins.NormalizeWhitespace = new NormalizeWhitespace({ + 'remove-trailing': true, + 'remove-indent': true, + 'left-trim': true, + 'right-trim': true, + /*'break-lines': 80, + 'indent': 2, + 'remove-initial-line-feed': false, + 'tabs-to-spaces': 4, + 'spaces-to-tabs': 4*/ + }); + + Prism.hooks.add('before-sanity-check', function (env) { + var Normalizer = Prism.plugins.NormalizeWhitespace; + + // Check settings + if (env.settings && env.settings['whitespace-normalization'] === false) { + return; + } + + // Check classes + if (!Prism.util.isActive(env.element, 'whitespace-normalization', true)) { + return; + } + + // Simple mode if there is no env.element + if ((!env.element || !env.element.parentNode) && env.code) { + env.code = Normalizer.normalize(env.code, env.settings); + return; + } + + // Normal mode + var pre = env.element.parentNode; + if (!env.code || !pre || pre.nodeName.toLowerCase() !== 'pre') { + return; + } + + var children = pre.childNodes; + var before = ''; + var after = ''; + var codeFound = false; + + // Move surrounding whitespace from the
 tag into the  tag
+		for (var i = 0; i < children.length; ++i) {
+			var node = children[i];
+
+			if (node == env.element) {
+				codeFound = true;
+			} else if (node.nodeName === '#text') {
+				if (codeFound) {
+					after += node.nodeValue;
+				} else {
+					before += node.nodeValue;
+				}
+
+				pre.removeChild(node);
+				--i;
+			}
+		}
+
+		if (!env.element.children.length || !Prism.plugins.KeepMarkup) {
+			env.code = before + env.code + after;
+			env.code = Normalizer.normalize(env.code, env.settings);
+		} else {
+			// Preserve markup for keep-markup plugin
+			var html = before + env.element.innerHTML + after;
+			env.element.innerHTML = Normalizer.normalize(html, env.settings);
+			env.code = env.element.textContent;
+		}
+	});
+
+}());
+
diff --git a/source/text/sbasic/shared/03/lib_tools.xhp b/source/text/sbasic/shared/03/lib_tools.xhp
index 97a6935ae8..5c2c7512e1 100644
--- a/source/text/sbasic/shared/03/lib_tools.xhp
+++ b/source/text/sbasic/shared/03/lib_tools.xhp
@@ -37,168 +37,74 @@
     
Debug Module Functions and subroutines for debugging Basic macros. - - - - Macro - - - Calling parameters and comments - - - - - ActivateReadOnlyFlag - - - - Sub ActivateReadOnlyFlag() - - - - - - DeactivateReadOnlyFlag - - - - Sub DeactivateReadOnlyFlag() - - - - - - SetBasicReadOnlyFlag - - - - Sub SetBasicReadOnlyFlag(bReadOnly as Boolean) - - - - - - WritedbgInfo - - - - Sub WritedbgInfo(LocObject as Object) - - - - - - WriteDbgString - - - - Sub WriteDbgString(LocString as String) - - - - - - ShowArray - - - - Sub ShowArray(LocArray()) - - - - - - ShowPropertyValues - - - - Sub ShowPropertyValues(oLocObject as Object) - - - - - - ShowNameValuePair - - - - Sub ShowNameValuePair(Pair()) - - - - - - ShowElementNames - - - ' Retrieves all the Elements of aSequence of an object, with the - ' possibility to define a filter(sfilter <> "") - - Sub ShowElementNames( - oLocElements() as Object, - Optional sFiltername as String) - - - - - - ShowSupportedServiceNames - - - ' Retrieves all the supported servicenames of an object, with the - ' possibility to define a filter(sfilter <> "") - - Sub ShowSupportedServiceNames( - oLocObject as Object, - Optional sFilterName as String) - - - - - - ShowAvailableServiceNames - - - ' Retrieves all the available Servicenames of an object, with the - ' possibility to define a filter(sfilter <> "") - - Sub ShowAvailableServiceNames( - oLocObject as Object, - Optional sFilterName as String) - - - - - - ShowCommands - - - - Sub ShowCommands(oLocObject as Object) - - - - - - ProtectCurrentSheets - - - - Sub ProtectCurrentSheets() - - - - - - FillDocument - - - - Sub FillDocument() - - - -
+

ActivateReadOnlyFlag

+ + Sub ActivateReadOnlyFlag() + +

DeactivateReadOnlyFlag

+ + Sub DeactivateReadOnlyFlag() + +

SetBasicReadOnlyFlag

+ + Sub SetBasicReadOnlyFlag(bReadOnly as Boolean) + +

WritedbgInfo

+ + Sub WritedbgInfo(LocObject as Object) + +

WriteDbgString

+ + Sub WriteDbgString(LocString as String) + +

ShowArray

+ + Sub ShowArray(LocArray()) + +

ShowPropertyValues

+ + Sub ShowPropertyValues(oLocObject as Object) + +

ShowNameValuePair

+ + Sub ShowNameValuePair(Pair()) + +

ShowElementNames

+ ' Retrieves all the Elements of aSequence of an object, with the + ' possibility to define a filter(sfilter <> "") + + Sub ShowElementNames( + oLocElements() as Object, + Optional sFiltername as String) + +

ShowSupportedServiceNames

+ ' Retrieves all the supported servicenames of an object, with the + ' possibility to define a filter(sfilter <> "") + + Sub ShowSupportedServiceNames( + oLocObject as Object, + Optional sFilterName as String) + +

ShowAvailableServiceNames

+ ' Retrieves all the available Servicenames of an object, with the + ' possibility to define a filter(sfilter <> "") + + Sub ShowAvailableServiceNames( + oLocObject as Object, + Optional sFilterName as String) + +

ShowCommands

+ + Sub ShowCommands(oLocObject as Object) + +

ProtectCurrentSheets

+ + Sub ProtectCurrentSheets() + +

FillDocument

+ + Sub FillDocument() +
BASIC Tools library;ListBox module @@ -214,566 +120,280 @@
Misc Module Miscellaneous functions and subroutines. - - - - - - - - - - - - RegisterNewDataSource - - - - Function RegisterNewDataSource( - DSName as String, - PropertyList(), - Optional DriverProperties() - as New com.sun.star.beans.PropertyValue) - - - - - - ConnecttoDatabase - - - - Function ConnecttoDatabase( - DSName as String, - UserID as String, - Password as String, - Optional Propertylist(), - Optional DriverProperties() - as New com.sun.star.beans.PropertyValue) - - - - - - GetStarOfficeLocale - - - - Function GetStarOfficeLocale() - as New com.sun.star.lang.Locale - - - - - - GetRegistryKeyContent - - - - Function GetRegistryKeyContent( - sKeyName as string, - Optional bforUpdate as Boolean) - - - - - - GetProductname - - - - Function GetProductname() as String - - - - - - OpenDocument - - - ' Opens a Document, checks beforehand, whether it has to be loaded or whether it is already on the desktop. If the parameter bDisposable is set to False then the returned document should not be disposed afterwards, because it is already opened. - - Function OpenDocument( - DocPath as String, - Args(), - Optional bDisposable as Boolean) - - - - - - TaskonDesktop - - - - Function TaskonDesktop(DocPath as String) as Boolean - - - - - - RetrieveFileName - - - ' Retrieves a FileName out of a StarOffice-Document. - - Function RetrieveFileName(LocDoc as Object) - - - - - - GetPathSettings - - - ' Gets a special configured PathSetting. - - Function GetPathSettings( - sPathType as String, - Optional bshowall as Boolean, - Optional ListIndex as integer) as String - - - - - - GetOfficeSubPath - - - ' Gets the fully qualified path to a subdirectory of the Template Directory, e. g. with the parameter "wizard/bitmap". The parameter must be passed over in Url-scription. The return-Value is in Urlscription. - - Function GetOfficeSubPath( - sOfficePath as String, - ByVal sSubDir as String) - - - - - - ShowNoOfficePathError - - - - Sub ShowNoOfficePathError() - - - - - - InitResources - - - - Function InitResources( - Description, - ShortDescription as String) as boolean - - - - - - GetResText - - - - Function GetResText( nID as integer ) As string - - - - - - CutPathView - - - - Function CutPathView( - sDocUrl as String, - Optional PathLen as Integer) - - - - - - DeleteInputCells - - - ' Deletes the content of all cells that are softformatted according to the 'InputStyleName'. - - Sub DeleteInputCells( - oSheet as Object, - InputStyleName as String) - - - - - - ChangeValueofRange - - - ' Inserts a certain String to all cells of a Range that ist passed over either as an object or as the RangeName. - - Sub ChangeValueofRange( - oSheet as Object, - Range, - ReplaceValue, - Optional StyleName as String) - - - - - - ReplaceRangeValues - - - - Sub ReplaceRangeValues( - oRange as Object, - ReplaceValue) - - - - - - GetValueofCellbyName - - - ' Returns the Value of the first cell of a Range. - - Function GetValueofCellbyName( - oSheet as Object, - sCellName as String) - - - - - - DuplicateRow - - - - Function DuplicateRow( - oSheet as Object, - RangeName as String) - - - - - - GetStringofCellbyName - - - ' Returns the String of the first cell of a Range. - - Function GetStringofCellbyName( - oSheet as Object, - sCellName as String) - - - - - - GetCellByName - - - ' Returns a named Cell - - Function GetCellByName( - oSheet as Object, - sCellName as String) as Object - - - - - - ChangeCellValue - - - ' Changes the numeric Value of a cell by transmitting the String of the numeric Value. - - Sub ChangeCellValue( - oCell as Object, - ValueString as String) - - - - - - GetDocumentType - - - - Function GetDocumentType(oDocument) - - - - - - GetNumberFormatType - - - - Function GetNumberFormatType( - oDocFormats, - oFormatObject as Object) as Integer - - - - - - ProtectSheets - - - - Sub ProtectSheets(Optional oSheets as Object) - - - - - - UnprotectSheets - - - - Sub UnprotectSheets(Optional oSheets as Object) - - - - - - GetRowIndex - - - - Function GetRowIndex( - oSheet as Object, - RowName as String) - - - - - - GetColumnIndex - - - - Function GetColumnIndex( - oSheet as Object, - ColName as String) - - - - - - CopySheetbyName - - - - Function CopySheetbyName( - oSheets as Object, - OldName as String, - NewName as String, - DestPos as Integer) as Object - - - - - - ToggleWindow - - - ' Dis-or enables a Window and adjusts the mousepointer accordingly - - Sub ToggleWindow(bDoEnable as Boolean) - - - - - - CheckNewSheetname - - - - Function CheckNewSheetname( - oSheets as Object, - Sheetname as String, - Optional oLocale) as String - - - - - - AddNewSheetName - - - - Sub AddNewSheetName( - oSheets as Object, - ByVal SheetName as String) - - - - - - GetSheetIndex - - - - Function GetSheetIndex(oSheets, sName) as Integer - - - - - - GetLastUsedRow - - - - Function GetLastUsedRow(oSheet as Object) as Integer - - - - - - ModifyBorderLineWidth - - - ' Note To set a one lined frame you have to set the inner width to 0 In the API all Units that refer to pt-Heights are "1/100mm" The convert factor from 1pt to 1/100 mm is approximately 35 - - Function ModifyBorderLineWidth( - ByVal oStyleBorder, - iInnerLineWidth as Integer, - iOuterLineWidth as Integer) - - - - - - AttachBasicMacroToEvent - - - - Sub AttachBasicMacroToEvent( - oDocument as Object, - EventName as String, - SubPath as String) - - - - - - ModifyPropertyValue - - - - Function ModifyPropertyValue( - oContent() as New com.sun.star.beans.PropertyValue, - TargetProperties() - as New com.sun.star.beans.PropertyValue) - - - - - - GetPropertyValueIndex - - - - Function GetPropertyValueIndex( - SearchName as String, - TargetProperties() - as New com.sun.star.beans.PropertyValue ) as Integer - - - - - - DispatchSlot - - - - Sub DispatchSlot(SlotID as Integer) - - - - - - IsFatOffice - - - 'returns the type of the office application FatOffice = 0, WebTop = 1 This routine has to be changed if the Product Name is being changed! - - Function IsFatOffice() As Boolean - - - - - - GetLocale - - - - Function GetLocale( - sLanguage as String, - sCountry as String) - - - - - - ToggleDesignMode - - - - Sub ToggleDesignMode(oDocument as Object) - - - - - - isHighContrast - - - - Function isHighContrast(oPeer as Object) - - - - - - CreateNewDocument - - - - Function CreateNewDocument( - sType as String, - Optional sAddMsg as String) as Object - - - - - - DisposeDocument - - - ' This Sub has been used in order to ensure that after disposing a document from the backing window it is returned to the backing window, so the office won't be closed - - Sub DisposeDocument(oDocument as Object) - - - - - - CalIsLeapYear - - - 'Function to calculate if the year is a leap year - - Function CalIsLeapYear( - ByVal iYear as Integer) as Boolean - - - -
+

RegisterNewDataSource

+ + Function RegisterNewDataSource( + DSName as String, + PropertyList(), + Optional DriverProperties() + as New com.sun.star.beans.PropertyValue) + +

ConnecttoDatabase

+ + Function ConnecttoDatabase( + DSName as String, + UserID as String, + Password as String, + Optional Propertylist(), + Optional DriverProperties() + as New com.sun.star.beans.PropertyValue) + +

GetStarOfficeLocale

+ + Function GetStarOfficeLocale() + as New com.sun.star.lang.Locale + +

GetRegistryKeyContent

+ + Function GetRegistryKeyContent( + sKeyName as string, + Optional bforUpdate as Boolean) + +

GetProductname

+ + Function GetProductname() as String + +

OpenDocument

+ ' Opens a Document, checks beforehand, whether it has to be loaded or whether it is already on the desktop. If the parameter bDisposable is set to False then the returned document should not be disposed afterwards, because it is already opened. + + Function OpenDocument( + DocPath as String, + Args(), + Optional bDisposable as Boolean) + +

TaskonDesktop

+ + Function TaskonDesktop(DocPath as String) as Boolean + +

RetrieveFileName

+ ' Retrieves a FileName out of a StarOffice-Document. + + Function RetrieveFileName(LocDoc as Object) + +

GetPathSettings

+ ' Gets a special configured PathSetting. + + Function GetPathSettings( + sPathType as String, + Optional bshowall as Boolean, + Optional ListIndex as integer) as String + +

GetOfficeSubPath

+ ' Gets the fully qualified path to a subdirectory of the Template Directory, e. g. with the parameter "wizard/bitmap". The parameter must be passed over in Url-scription. The return-Value is in Urlscription. + + Function GetOfficeSubPath( + sOfficePath as String, + ByVal sSubDir as String) + +

ShowNoOfficePathError

+ + Sub ShowNoOfficePathError() + +

InitResources

+ + Function InitResources( + Description, + ShortDescription as String) as boolean + +

GetResText

+ + Function GetResText( nID as integer ) As string + +

CutPathView

+ + Function CutPathView( + sDocUrl as String, + Optional PathLen as Integer) + +

DeleteInputCells

+ ' Deletes the content of all cells that are softformatted according to the 'InputStyleName'. + + Sub DeleteInputCells( + oSheet as Object, + InputStyleName as String) + +

ChangeValueofRange

+ ' Inserts a certain String to all cells of a Range that ist passed over either as an object or as the RangeName. + + Sub ChangeValueofRange( + oSheet as Object, + Range, + ReplaceValue, + Optional StyleName as String) + +

ReplaceRangeValues

+ + Sub ReplaceRangeValues( + oRange as Object, + ReplaceValue) + +

GetValueofCellbyName

+ ' Returns the Value of the first cell of a Range. + + Function GetValueofCellbyName( + oSheet as Object, + sCellName as String) + +

DuplicateRow

+ + Function DuplicateRow( + oSheet as Object, + RangeName as String) + +

GetStringofCellbyName

+ ' Returns the String of the first cell of a Range. + + Function GetStringofCellbyName( + oSheet as Object, + sCellName as String) + +

GetCellByName

+ ' Returns a named Cell + + Function GetCellByName( + oSheet as Object, + sCellName as String) as Object + +

ChangeCellValue

+ ' Changes the numeric Value of a cell by transmitting the String of the numeric Value. + + Sub ChangeCellValue( + oCell as Object, + ValueString as String) + +

GetDocumentType

+ + Function GetDocumentType(oDocument) + +

GetNumberFormatType

+ + Function GetNumberFormatType( + oDocFormats, + oFormatObject as Object) as Integer + +

ProtectSheets

+ + Sub ProtectSheets(Optional oSheets as Object) + +

UnprotectSheets

+ + Sub UnprotectSheets(Optional oSheets as Object) + +

GetRowIndex

+ + Function GetRowIndex( + oSheet as Object, + RowName as String) + +

GetColumnIndex

+ + Function GetColumnIndex( + oSheet as Object, + ColName as String) + +

CopySheetbyName

+ + Function CopySheetbyName( + oSheets as Object, + OldName as String, + NewName as String, + DestPos as Integer) as Object + +

ToggleWindow

+ ' Dis-or enables a Window and adjusts the mousepointer accordingly + + Sub ToggleWindow(bDoEnable as Boolean) + +

CheckNewSheetname

+ + Function CheckNewSheetname( + oSheets as Object, + Sheetname as String, + Optional oLocale) as String + +

AddNewSheetName

+ + Sub AddNewSheetName( + oSheets as Object, + ByVal SheetName as String) + +

GetSheetIndex

+ + Function GetSheetIndex(oSheets, sName) as Integer + +

GetLastUsedRow

+ + Function GetLastUsedRow(oSheet as Object) as Integer + +

ModifyBorderLineWidth

+ ' Note To set a one lined frame you have to set the inner width to 0 In the API all Units that refer to pt-Heights are "1/100mm" The convert factor from 1pt to 1/100 mm is approximately 35 + + Function ModifyBorderLineWidth( + ByVal oStyleBorder, + iInnerLineWidth as Integer, + iOuterLineWidth as Integer) + +

AttachBasicMacroToEvent

+ + Sub AttachBasicMacroToEvent( + oDocument as Object, + EventName as String, + SubPath as String) + +

ModifyPropertyValue

+ + Function ModifyPropertyValue( + oContent() as New com.sun.star.beans.PropertyValue, + TargetProperties() + as New com.sun.star.beans.PropertyValue) + +

GetPropertyValueIndex

+ + Function GetPropertyValueIndex( + SearchName as String, + TargetProperties() + as New com.sun.star.beans.PropertyValue ) as Integer + +

DispatchSlot

+ + Sub DispatchSlot(SlotID as Integer) + +

IsFatOffice

+ 'returns the type of the office application FatOffice = 0, WebTop = 1 This routine has to be changed if the Product Name is being changed! + + Function IsFatOffice() As Boolean + +

GetLocale

+ + Function GetLocale( + sLanguage as String, + sCountry as String) + +

ToggleDesignMode

+ + Sub ToggleDesignMode(oDocument as Object) + +

isHighContrast

+ + Function isHighContrast(oPeer as Object) + +

CreateNewDocument

+ + Function CreateNewDocument( + sType as String, + Optional sAddMsg as String) as Object + +

DisposeDocument

+ ' This Sub has been used in order to ensure that after disposing a document from the backing window it is returned to the backing window, so the office won't be closed + + Sub DisposeDocument(oDocument as Object) + +

CalIsLeapYear

+ 'Function to calculate if the year is a leap year + + Function CalIsLeapYear( + ByVal iYear as Integer) as Boolean +
BASIC Tools library;ModuleControl module @@ -781,248 +401,130 @@
ModuleControls Module Functions and subroutines for module control. - - - - - - - - - - - - GetControlShape - - - ' Gets the Shape of a Control( e. g. to reset the size or Position of the control - ' Parameters: - ' The 'oContainer' is the Document or a specific sheet of a Calc - Document - ' 'CName' is the Name of the Control - - Function GetControlShape( - oContainer as Object, - CName as String) - - - - - - getControlView - - - ' Returns the View of a Control - ' Parameters: - ' The 'oContainer' is the Document or a specific sheet of a Calc - Document - ' The 'oController' is always directly attached to the Document - ' 'CName' is the Name of the Control - - Function getControlView( - oContainer , - oController as Object, - CName as String) as Object - - - - - - DisposeControl - - - ' Parameters: - ' The 'oContainer' is the Document or a specific sheet of a Calc - Document - ' 'CName' is the Name of the Control - - Function DisposeControl( - oContainer as Object, - CName as String) as Boolean - - - - - - GetControlGroupModel - - - ' Returns a sequence of a group of controls like option buttons or checkboxes - ' The 'oContainer' is the Document or a specific sheet of a Calc - Document - ' 'sGroupName' is the Name of the Controlgroup - - Function GetControlGroupModel( - oContainer as Object, - sGroupName as String ) - - - - - - GetRefValue - - - ' Returns the Referencevalue of a group of e.g. option buttons or check boxes - ' 'oControlGroup' is a sequence of the Control objects - - Function GetRefValue( - oControlGroup() as Object) - - - - - - GetRefValueOfControlGroup - - - - Function GetRefValueOfControlGroup( - oContainer as Object, - GroupName as String) - - - - - - GetOptionGroupValue - - - - Function GetOptionGroupValue( - oContainer as Object, - OptGroupName as String) as Boolean - - - - - - WriteOptValueToCell - - - - Function WriteOptValueToCell( - oSheet as Object, - OptGroupName as String, - iCol as Integer, - iRow as Integer) as Boolean - - - - - - LoadDialog - - - - Function LoadDialog( - Libname as String, - DialogName as String, - Optional oLibContainer) - - Refer to Opening a Dialog with Basic for an example of LoadDialog function. - - - - - GetFolderName - - - - Sub GetFolderName(oRefModel as Object) - - - - - - GetFileName - - - - Sub GetFileName( - oRefModel as Object, - Filternames()) - - - - - - StoreDocument - - - - Function StoreDocument( - oDocument as Object, - FilterNames() as String, - DefaultName as String, - DisplayDirectory as String, - Optional iAddProcedure as Integer) as String - - - - - - AddFiltersToDialog - - - - Sub AddFiltersToDialog( - FilterNames() as String, - oDialog as Object) - - - - - - SwitchMousePointer - - - - Sub SwitchMousePointer( - oWindowPeer as Object, - bDoEnable as Boolean) - - - - - - ShowOverwriteAllDialog - - - - Sub ShowOverwriteAllDialog( - FilePath as String, - sTitle as String) - - - - - - SetOVERWRITEToQuery - - - - Sub SetOVERWRITEToQuery() - - - - - - SetOVERWRITEToAlways - - - - Sub SetOVERWRITEToAlways() - - - - - - SetOVERWRITEToNever - - - - Sub SetOVERWRITEToNever() - - - -
+

GetControlShape

+ ' Gets the Shape of a Control( e. g. to reset the size or Position of the control + ' Parameters: + ' The 'oContainer' is the Document or a specific sheet of a Calc - Document + ' 'CName' is the Name of the Control + + Function GetControlShape( + oContainer as Object, + CName as String) + +

getControlView

+ ' Returns the View of a Control + ' Parameters: + ' The 'oContainer' is the Document or a specific sheet of a Calc - Document + ' The 'oController' is always directly attached to the Document + ' 'CName' is the Name of the Control + + Function getControlView( + oContainer , + oController as Object, + CName as String) as Object + +

DisposeControl

+ ' Parameters: + ' The 'oContainer' is the Document or a specific sheet of a Calc - Document + ' 'CName' is the Name of the Control + + Function DisposeControl( + oContainer as Object, + CName as String) as Boolean + +

GetControlGroupModel

+ ' Returns a sequence of a group of controls like option buttons or checkboxes + ' The 'oContainer' is the Document or a specific sheet of a Calc - Document + ' 'sGroupName' is the Name of the Controlgroup + + Function GetControlGroupModel( + oContainer as Object, + sGroupName as String ) + +

GetRefValue

+ ' Returns the Referencevalue of a group of e.g. option buttons or check boxes + ' 'oControlGroup' is a sequence of the Control objects + + Function GetRefValue( + oControlGroup() as Object) + +

GetRefValueOfControlGroup

+ + Function GetRefValueOfControlGroup( + oContainer as Object, + GroupName as String) + +

GetOptionGroupValue

+ + Function GetOptionGroupValue( + oContainer as Object, + OptGroupName as String) as Boolean + +

WriteOptValueToCell

+ + Function WriteOptValueToCell( + oSheet as Object, + OptGroupName as String, + iCol as Integer, + iRow as Integer) as Boolean + +

LoadDialog

+ + Function LoadDialog( + Libname as String, + DialogName as String, + Optional oLibContainer) + + Refer to Opening a Dialog with Basic for an example of LoadDialog function. +

GetFolderName

+ + Sub GetFolderName(oRefModel as Object) + +

GetFileName

+ + Sub GetFileName( + oRefModel as Object, + Filternames()) + +

StoreDocument

+ + Function StoreDocument( + oDocument as Object, + FilterNames() as String, + DefaultName as String, + DisplayDirectory as String, + Optional iAddProcedure as Integer) as String + +

AddFiltersToDialog

+ + Sub AddFiltersToDialog( + FilterNames() as String, + oDialog as Object) + +

SwitchMousePointer

+ + Sub SwitchMousePointer( + oWindowPeer as Object, + bDoEnable as Boolean) + +

ShowOverwriteAllDialog

+ + Sub ShowOverwriteAllDialog( + FilePath as String, + sTitle as String) + +

SetOVERWRITEToQuery

+ + Sub SetOVERWRITEToQuery() + +

SetOVERWRITEToAlways

+ + Sub SetOVERWRITEToAlways() + +

SetOVERWRITEToNever

+ + Sub SetOVERWRITEToNever() +
BASIC Tools library;Strings module @@ -1030,425 +532,235 @@
Strings Module Advanced functions and subroutines for string manipulation. - - - - - - - - - - - - ElimChar - - - - Function ElimChar( - ByVal BigString as String, - ElimArray() as String) - - - - - - DeleteStr - - - ' Deletes out of a String 'BigString' a possible Partstring 'CompString' - - Function DeleteStr( - ByVal BigString, - CompString as String) as String - - - - - - FindPartString - - - ' Finds a PartString, that is framed by the Strings 'Prestring' and 'PostString' - - Function FindPartString( - BigString, - PreString, - PostString as String, - SearchPos as Integer) as String - - - - - - PartStringInArray - - - ' Note iCompare = 0 (Binary comparison) - ' iCompare = 1 (Text comparison) - - Function PartStringInArray( - BigArray(), - SearchString as String, - iCompare as Integer) as Integer - - - - - - RTrimStr - - - ' Deletes the String 'SmallString' out of the String 'BigString' - ' in case SmallString's Position in BigString is right at the end - - Function RtrimStr( - ByVal BigString, - SmallString as String) as String - - - - - - LTRimChar - - - ' Deletes the Char 'CompChar' out of the String 'BigString' - ' in case CompChar's Position in BigString is right at the beginning - - Function LTRimChar( - ByVal BigString as String, - CompChar as String) as String - - - - - - ArrayOutOfString - - - ' Retrieves an Array out of a String. - ' The fields of the Array are separated by the parameter 'Separator', that is contained - ' in the Array - ' The Array MaxIndex delivers the highest Index of this Array - - Function ArrayOutOfString( - BigString, - Separator as String, - Optional MaxIndex as Integer) - - - - - - ClearArray - - - ' Deletes all fieldvalues in one-dimensional Array - - Sub ClearArray(BigArray) - - - - - - ClearMultiDimArray - - - ' Deletes all fieldvalues in a multidimensional Array - - Sub ClearMultiDimArray( - BigArray, - DimCount as integer) - - - - - - FieldinArray - - - ' Checks if a Field (LocField) is already defined in an Array - ' Returns 'True' or 'False' - - Function FieldinArray( - LocArray(), - MaxIndex as integer, - LocField as String) As Boolean - - - - - - FieldinList - - - ' Checks if a Field (LocField) is already defined in an Array - ' Returns 'True' or 'False' - - Function FieldinList( - LocField, - BigList()) As Boolean - - - - - - IndexinArray - - - ' Retrieves the Index of the delivered String 'SearchString' in - ' the Array LocList()' - - Function IndexinArray( - SearchString as String, - LocList()) as Integer - - - - - - MultiArrayInListbox - - - - Sub MultiArrayInListbox( - oDialog as Object, - ListboxName as String, - ValList(), - iDim as Integer) - - - - - - StringInMultiArray - - - ' Searches for a String in a two-dimensional Array by querying all Searchindexes of the second dimension - ' and delivers the specific String of the ReturnIndex in the second dimension of the Searchlist() - - Function StringInMultiArray( - SearchList(), - SearchString as String, - SearchIndex as Integer, - ReturnIndex as Integer, - Optional MaxIndex as Integer) as String - - - - - - GetIndexInMultiArray - - - ' Searches for a Value in multidimensial Array by querying all Searchindices of the passed dimension - ' and delivers the Index where it is found. - - Function GetIndexInMultiArray( - SearchList(), - SearchValue, - SearchIndex as Integer) as Integer - - - - - - GetIndexForPartString_ - inMultiArray - - - ' Searches for a Value in multidimensial Array by querying all Searchindices of the passed dimension - ' and delivers the Index where the Searchvalue is found as a part string - - Function GetIndexForPartStringinMultiArray( - SearchList(), - SearchValue, - SearchIndex as Integer) as Integer - - - - - - ArrayfromMultiArray - - - - Function ArrayfromMultiArray( - MultiArray as String, - iDim as Integer) - - - - - - ReplaceString - - - ' Replaces the string "OldReplace" through the String "NewReplace" in the String - ' 'BigString' - - Function ReplaceString( - ByVal Bigstring, - NewReplace, - OldReplace as String) as String - - - - - - FindSecondValue - - - ' Retrieves the second value for a next to 'SearchString' in - ' a two-dimensional string-Array - - Function FindSecondValue( - SearchString as String, - TwoDimList() as String ) as String - - - - - - Power - - - ' raises a base to a certain power - - Function Power( - Basis as Double, - Exponent as Double) as Double - - - - - - Round - - - ' rounds a Real to a given Number of Decimals - - Function Round( - BaseValue as Double, - Decimals as Integer) as Double - - - - - - FileNameoutofPath - - - 'Retrieves the mere filename out of a whole path - - Function FileNameoutofPath( - ByVal Path as String, - Optional Separator as String) as String - - - - - - GetFileNameExtension - - - - Function GetFileNameExtension( - ByVal FileName as String) - - - - - - GetFileNameWithoutExtension - - - - Function GetFileNameWithoutExtension( - ByVal FileName as String, - Optional Separator as String) - - - - - - DirectoryNameoutofPath - - - - Function DirectoryNameoutofPath( - sPath as String, - Separator as String) as String - - - - - - CountCharsinString - - - - Function CountCharsinString( - BigString, - LocChar as String, - ByVal StartPos as Integer) as Integer - - - - - - BubbleSortList - - - - Function BubbleSortList( - ByVal SortList(), - optional sort2ndValue as Boolean) - - 'This function bubble sorts an array of maximum 2 dimensions. - 'The default sorting order is the first dimension - 'Only if sort2ndValue is True the second dimension is the relevant for the sorting order - - - - - GetValueoutofList - - - - Function GetValueoutofList( - SearchValue, - BigList(), - iDim as Integer, - Optional ValueIndex) - - - - - - AddListtoList - - - - Function AddListtoList( - ByVal FirstArray(), - ByVal SecondArray(), - Optional StartIndex) - - - - - - CheckDouble - - - - Function CheckDouble(DoubleString as String) - - - -
+

ElimChar

+ + Function ElimChar( + ByVal BigString as String, + ElimArray() as String) + +

DeleteStr

+ ' Deletes out of a String 'BigString' a possible Partstring 'CompString' + + Function DeleteStr( + ByVal BigString, + CompString as String) as String + +

FindPartString

+ ' Finds a PartString, that is framed by the Strings 'Prestring' and 'PostString' + + Function FindPartString( + BigString, + PreString, + PostString as String, + SearchPos as Integer) as String + +

PartStringInArray

+ ' Note iCompare = 0 (Binary comparison) + ' iCompare = 1 (Text comparison) + + Function PartStringInArray( + BigArray(), + SearchString as String, + iCompare as Integer) as Integer + +

RTrimStr

+ ' Deletes the String 'SmallString' out of the String 'BigString' + ' in case SmallString's Position in BigString is right at the end + + Function RtrimStr( + ByVal BigString, + SmallString as String) as String + +

LTRimChar

+ ' Deletes the Char 'CompChar' out of the String 'BigString' + ' in case CompChar's Position in BigString is right at the beginning + + Function LTRimChar( + ByVal BigString as String, + CompChar as String) as String + +

ArrayOutOfString

+ ' Retrieves an Array out of a String. + ' The fields of the Array are separated by the parameter 'Separator', that is contained + ' in the Array + ' The Array MaxIndex delivers the highest Index of this Array + + Function ArrayOutOfString( + BigString, + Separator as String, + Optional MaxIndex as Integer) + +

ClearArray

+ ' Deletes all fieldvalues in one-dimensional Array + + Sub ClearArray(BigArray) + +

ClearMultiDimArray

+ ' Deletes all fieldvalues in a multidimensional Array + + Sub ClearMultiDimArray( + BigArray, + DimCount as integer) + +

FieldinArray

+ ' Checks if a Field (LocField) is already defined in an Array + ' Returns 'True' or 'False' + + Function FieldinArray( + LocArray(), + MaxIndex as integer, + LocField as String) As Boolean + +

FieldinList

+ ' Checks if a Field (LocField) is already defined in an Array + ' Returns 'True' or 'False' + + Function FieldinList( + LocField, + BigList()) As Boolean + +

IndexinArray

+ ' Retrieves the Index of the delivered String 'SearchString' in + ' the Array LocList()' + + Function IndexinArray( + SearchString as String, + LocList()) as Integer + +

MultiArrayInListbox

+ + Sub MultiArrayInListbox( + oDialog as Object, + ListboxName as String, + ValList(), + iDim as Integer) + +

StringInMultiArray

+ ' Searches for a String in a two-dimensional Array by querying all Searchindexes of the second dimension + ' and delivers the specific String of the ReturnIndex in the second dimension of the Searchlist() + + Function StringInMultiArray( + SearchList(), + SearchString as String, + SearchIndex as Integer, + ReturnIndex as Integer, + Optional MaxIndex as Integer) as String + +

GetIndexInMultiArray

+ ' Searches for a Value in multidimensial Array by querying all Searchindices of the passed dimension + ' and delivers the Index where it is found. + + Function GetIndexInMultiArray( + SearchList(), + SearchValue, + SearchIndex as Integer) as Integer + +

GetIndexForPartString_

+ inMultiArray + ' Searches for a Value in multidimensial Array by querying all Searchindices of the passed dimension + ' and delivers the Index where the Searchvalue is found as a part string + + Function GetIndexForPartStringinMultiArray( + SearchList(), + SearchValue, + SearchIndex as Integer) as Integer + +

ArrayfromMultiArray

+ + Function ArrayfromMultiArray( + MultiArray as String, + iDim as Integer) + +

ReplaceString

+ ' Replaces the string "OldReplace" through the String "NewReplace" in the String + ' 'BigString' + + Function ReplaceString( + ByVal Bigstring, + NewReplace, + OldReplace as String) as String + +

FindSecondValue

+ ' Retrieves the second value for a next to 'SearchString' in + ' a two-dimensional string-Array + + Function FindSecondValue( + SearchString as String, + TwoDimList() as String ) as String + +

Power

+ ' raises a base to a certain power + + Function Power( + Basis as Double, + Exponent as Double) as Double + +

Round

+ ' rounds a Real to a given Number of Decimals + + Function Round( + BaseValue as Double, + Decimals as Integer) as Double + +

FileNameoutofPath

+ 'Retrieves the mere filename out of a whole path + + Function FileNameoutofPath( + ByVal Path as String, + Optional Separator as String) as String + +

GetFileNameExtension

+ + Function GetFileNameExtension( + ByVal FileName as String) + +

GetFileNameWithoutExtension

+ + Function GetFileNameWithoutExtension( + ByVal FileName as String, + Optional Separator as String) + +

DirectoryNameoutofPath

+ + Function DirectoryNameoutofPath( + sPath as String, + Separator as String) as String + +

CountCharsinString

+ + Function CountCharsinString( + BigString, + LocChar as String, + ByVal StartPos as Integer) as Integer + +

BubbleSortList

+ + Function BubbleSortList( + ByVal SortList(), + optional sort2ndValue as Boolean) + + 'This function bubble sorts an array of maximum 2 dimensions. + 'The default sorting order is the first dimension + 'Only if sort2ndValue is True the second dimension is the relevant for the sorting order +

GetValueoutofList

+ + Function GetValueoutofList( + SearchValue, + BigList(), + iDim as Integer, + Optional ValueIndex) + +

AddListtoList

+ + Function AddListtoList( + ByVal FirstArray(), + ByVal SecondArray(), + Optional StartIndex) + +

CheckDouble

+ + Function CheckDouble(DoubleString as String) +
BASIC Tools library;UCB module @@ -1456,142 +768,72 @@
UCB Module Universal Content Broker functions and subroutines. - - - - - - - - - - - - ReadDirectories - - - - Function ReadDirectories( - ByVal AnchorDir As String, - bRecursive as Boolean, - bcheckFileType as Boolean, - bGetByTitle as Boolean, - Optional sFileContent(), - Optional sExtension as String) - - - - - - AddFoldertoList - - - - Sub AddFoldertoList( - sDirURL as String, - iDirIndex) - - - - - - AddFileNameToList - - - - Sub AddFileNameToList( - sFileArray(), - FileName as String, - FileContent as String, - bGetByTitle as Boolean, - CurIndex) - - - - - - RetrieveDocTitle - - - - Function RetrieveDocTitle( - oDocProps as Object, - sFileName as String) As String - - - - - - GetRealFileContent - - - ' Retrieves The Filecontent of a Document by extracting the content - ' from the Header of the document - - Function GetRealFileContent( - FileName as String) As String - - - - - - CopyRecursively - - - - Function CopyRecursively( - SourceFilePath as String, - SourceStemDir as String, - TargetStemDir as String) - - - - - - ShowHelperDialog - - - ' Opens a help url referenced by a Help ID that is retrieved from the calling button tag - - Sub ShowHelperDialog(aEvent) - - - - - - SaveDataToFile - - - - Sub SaveDataToFile( - FilePath as String, - DataList()) - - - - - - LoadDataFromFile - - - - Function LoadDataFromFile( - FilePath as String, - DataList()) as Boolean - - - - - - CreateFolder - - - - Function CreateFolder(sNewFolder) as Boolean - - - -
+

ReadDirectories

+ + Function ReadDirectories( + ByVal AnchorDir As String, + bRecursive as Boolean, + bcheckFileType as Boolean, + bGetByTitle as Boolean, + Optional sFileContent(), + Optional sExtension as String) + +

AddFoldertoList

+ + Sub AddFoldertoList( + sDirURL as String, + iDirIndex) + +

AddFileNameToList

+ + Sub AddFileNameToList( + sFileArray(), + FileName as String, + FileContent as String, + bGetByTitle as Boolean, + CurIndex) + +

RetrieveDocTitle

+ + Function RetrieveDocTitle( + oDocProps as Object, + sFileName as String) As String + +

GetRealFileContent

+ ' Retrieves The Filecontent of a Document by extracting the content + ' from the Header of the document + + Function GetRealFileContent( + FileName as String) As String + +

CopyRecursively

+ + Function CopyRecursively( + SourceFilePath as String, + SourceStemDir as String, + TargetStemDir as String) + +

ShowHelperDialog

+ ' Opens a help url referenced by a Help ID that is retrieved from the calling button tag + + Sub ShowHelperDialog(aEvent) + +

SaveDataToFile

+ + Sub SaveDataToFile( + FilePath as String, + DataList()) + +

LoadDataFromFile

+ + Function LoadDataFromFile( + FilePath as String, + DataList()) as Boolean + +

CreateFolder

+ + Function CreateFolder(sNewFolder) as Boolean +
-- cgit