Skip to content

Commit

Permalink
first release
Browse files Browse the repository at this point in the history
  • Loading branch information
awaysoft committed Mar 29, 2016
1 parent 3fba549 commit 4edac13
Show file tree
Hide file tree
Showing 17 changed files with 1,156 additions and 0 deletions.
80 changes: 80 additions & 0 deletions Addons.xcu
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version='1.0' encoding='UTF-8'?>
<oor:component-data
xmlns:oor="http://openoffice.org/2001/registry"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
oor:name="Addons"
oor:package="org.openoffice.Office">
<node oor:name="AddonUI">
<!--<node oor:name="AddonMenu">
<node oor:name="RemoveDuplicates.AddonMenu.m1" oor:op="replace">
<prop oor:name="Context" oor:type="xs:string">
<value>com.sun.star.sheet.SpreadsheetDocument</value>
</prop>
<prop oor:name="URL" oor:type="xs:string">
<value>vnd.sun.star.script:RemoveDuplicates.RemoveDuplicates.RemoveDuplicates?language=Basic&amp;location=application</value>
</prop>
<prop oor:name="ImageIdentifier" oor:type="xs:string">
<value>%origin%/icons/image1</value>
</prop>
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Remove Duplicates...</value>
<value xml:lang="zh_CN">删除重复项...</value>
</prop>
<prop oor:name="Target" oor:type="xs:string">
<value>_self</value>
</prop>
</node>
</node>-->
<node oor:name="OfficeMenuBarMerging">
<node oor:name="vnd.actom.removeduplicates" oor:op="replace">
<node oor:name="S1" oor:op="replace">
<prop oor:name="MergePoint">
<value>.uno:DataMenu\.uno:FilterMenu</value>
</prop>
<prop oor:name="MergeCommand">
<value>AddAfter</value>
</prop>
<prop oor:name="MergeFallback">
<value>AddPath</value>
</prop>
<prop oor:name="ImageIdentifier" oor:type="xs:string">
<value>%origin%/icons/image1_26.png</value>
</prop>
<node oor:name="MenuItems">
<node oor:name="M1" oor:op="replace">
<prop oor:name="Context" oor:type="xs:string">
<value>com.sun.star.sheet.SpreadsheetDocument</value>
</prop>
<prop oor:name="URL" oor:type="xs:string">
<value>vnd.sun.star.script:RemoveDuplicates.RemoveDuplicates.RemoveDuplicates?language=Basic&amp;location=application</value>
</prop>
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Remove Duplicates...</value>
<value xml:lang="zh_CN">删除重复项...</value>
</prop>
</node>
</node>
</node>
</node>
</node>
<node oor:name="OfficeToolBar">
<node oor:name="vnd.actom.removeduplicates" oor:op="replace">
<node oor:name="M1" oor:op="replace">
<prop oor:name="Context" oor:type="xs:string">
<value>com.sun.star.sheet.SpreadsheetDocument</value>
</prop>
<prop oor:name="URL" oor:type="xs:string">
<value>vnd.sun.star.script:RemoveDuplicates.RemoveDuplicates.RemoveDuplicates?language=Basic&amp;location=application</value>
</prop>
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Remove Duplicates...</value>
<value xml:lang="zh_CN">删除重复项...</value>
</prop>
<prop oor:name="ImageIdentifier" oor:type="xs:string">
<value>%origin%/icons/image1</value>
</prop>
</node>
</node>
</node>
</node>
</oor:component-data>
6 changes: 6 additions & 0 deletions META-INF/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest:manifest>
<manifest:file-entry manifest:full-path="RemoveDuplicates/" manifest:media-type="application/vnd.sun.star.basic-library"/>
<manifest:file-entry manifest:full-path="pkg-desc/pkg-description.txt" manifest:media-type="application/vnd.sun.star.package-bundle-description"/>
<manifest:file-entry manifest:full-path="Addons.xcu" manifest:media-type="application/vnd.sun.star.configuration-data"/>
</manifest:manifest>
63 changes: 63 additions & 0 deletions RemoveDuplicates/Locate.xba
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Locate" script:language="StarBasic">REM ***** BASIC *****

Dim stringLists() As String
Dim language As String

Function getLanguage
GlobalScope.BasicLibraries.LoadLibrary(&quot;Tools&quot;)
getLanguage = GetStarOfficeLocale().language + &quot;_&quot; + GetStarOfficeLocale().country
End Function

Function getText(index)
getText = stringLists(index)
End Function

Function inArray(source, array)
For i = 0 to ubound(array)
If array(i) = source Then
inArray = True
Exit Function
End If
Next i
inArray = False
End Function

Sub InitLanguage
Dim languageList()
languageList() = array(&quot;en&quot;, &quot;zh_CN&quot;)
language = getLanguage
If not inArray(language, languageList) Then
language = &quot;en&quot;
End If
Select Case language
Case &quot;en&quot;
load_en
Case &quot;zh_CN&quot;
load_zh_CN
End Select
End Sub

Sub load_en
stringLists() = array(&quot;Do not support multiselection&quot;, _
&quot;Please select a range&quot;, _
&quot;Column &quot;, _
&quot;Select ~All&quot;, _
&quot;~Selection includes title&quot;, _
&quot;~Please select the duplicate columns (Press Ctrl to multiselect):&quot;, _
&quot;~OK&quot;, _
&quot;~Cancel&quot;)
End Sub

Sub load_zh_CN
stringLists() = array(&quot;不支持多重选择区域&quot;, _
&quot;请选择一个区域&quot;, _
&quot;&quot;, _
&quot;选择全部(~A)&quot;, _
&quot;选区包含了列名(~S)&quot;, _
&quot;请选择判断重复的列(按住Ctrl键可以多选)(~P):&quot;, _
&quot;确定(~O)&quot;, _
&quot;取消(~C)&quot;)
End Sub
</script:module>
20 changes: 20 additions & 0 deletions RemoveDuplicates/Options.xdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Options" dlg:left="135" dlg:top="55" dlg:width="182" dlg:height="144" dlg:closeable="true" dlg:moveable="true">
<dlg:bulletinboard>
<dlg:text dlg:id="OptionHint" dlg:tab-index="0" dlg:left="7" dlg:top="4" dlg:width="170" dlg:height="9" dlg:value="~Please select the duplicate columns (Press Ctrl to multiselect)"/>
<dlg:checkbox dlg:id="cbTitle" dlg:tab-index="1" dlg:left="115" dlg:top="113" dlg:width="63" dlg:height="7" dlg:value="~Selection includes title" dlg:checked="true">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:RemoveDuplicates.RemoveDuplicates.cbIncludeTitle?language=Basic&amp;location=application" script:language="Script"/>
</dlg:checkbox>
<dlg:button dlg:id="btnSelectAll" dlg:tab-index="2" dlg:left="8" dlg:top="111" dlg:width="38" dlg:height="14" dlg:value="Select ~All">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:RemoveDuplicates.RemoveDuplicates.btnSelectAllClick?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:button dlg:id="btnOK" dlg:tab-index="3" dlg:left="100" dlg:top="129" dlg:width="38" dlg:height="14" dlg:default="true" dlg:value="~OK">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:RemoveDuplicates.RemoveDuplicates.btnOKClick?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:button dlg:id="btnCancel" dlg:tab-index="4" dlg:left="140" dlg:top="129" dlg:width="38" dlg:height="14" dlg:default="true" dlg:value="~Cancel">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:RemoveDuplicates.RemoveDuplicates.btnCancelClick?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button>
<dlg:menulist dlg:id="lbList" dlg:tab-index="5" dlg:left="7" dlg:top="18" dlg:width="172" dlg:height="87" dlg:multiselection="true"/>
</dlg:bulletinboard>
</dlg:window>
Loading

0 comments on commit 4edac13

Please sign in to comment.