Skip to content

Commit d312c05

Browse files
committed
files added
1 parent 107daf9 commit d312c05

File tree

9 files changed

+412
-0
lines changed

9 files changed

+412
-0
lines changed

Addons.xcu

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<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">
3+
<node oor:name="AddonUI">
4+
<node oor:name="AddonMenu">
5+
<node oor:name="Bureken.addon.TcNoControl" oor:op="replace">
6+
<prop oor:name="Context" oor:type="xs:string">
7+
<value>com.sun.star.sheet.SpreadsheetDocument</value>
8+
</prop>
9+
<prop oor:name="Title" oor:type="xs:string">
10+
<value xml:lang="tr-TR">Tc Kimlik No Kontrol</value>
11+
</prop>
12+
<prop oor:name="URL" oor:type="xs:string">
13+
<value>macro:///TcNoControl.TcControl.TcKimlikKontrol</value>
14+
</prop>
15+
<prop oor:name="Target" oor:type="xs:string">
16+
<value>_self</value>
17+
</prop>
18+
</node>
19+
</node>
20+
</node>
21+
</oor:component-data>

META-INF/manifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<manifest:manifest>
3+
<manifest:file-entry manifest:full-path="TcNoControl/" manifest:media-type="application/vnd.sun.star.basic-library"/>
4+
<manifest:file-entry manifest:full-path="pkg-desc/pkg-description.txt" manifest:media-type="application/vnd.sun.star.package-bundle-description"/>
5+
<manifest:file-entry manifest:full-path="Addons.xcu" manifest:media-type="application/vnd.sun.star.configuration-data"/>

TcControl.oxt

15.6 KB
Binary file not shown.

TcNoControl/TcControl.xba

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3+
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="TcNoControl" script:language="StarBasic">
4+
5+
6+
7+
Function GetCellPositionRow(Cell) as integer
8+
oSheet = ThisComponent.getCurrentController().getActiveSheet()
9+
oCell = oSheet.getCellRangeByName(Cell)
10+
aCellAddress = oCell.getCellAddress()
11+
GetCellPositionRow = aCellAddress.Row
12+
End Function
13+
14+
15+
Function GetCellPositionColumn(Cell) as integer
16+
oSheet = ThisComponent.getCurrentController().getActiveSheet()
17+
oCell = oSheet.getCellRangeByName(Cell)
18+
aCellAddress = oCell.getCellAddress()
19+
GetCellPositionColumn = aCellAddress.Column
20+
End Function
21+
22+
23+
Function Control(CellRow, CellColumn)
24+
25+
Dim objActiveSheet as object
26+
Dim oCell as object
27+
Dim mod1 as Integer, mod2 As Integer
28+
Dim TC1 as Integer, TC2 as Integer, TC3 as Integer, TC4 as Integer, TC5 as Integer, TC6 as Integer, TC7 as Integer, TC8 as Integer, TC9 as Integer, TC10 as Integer, TC11 As Integer
29+
objActiveSheet = ThisComponent.getCurrentController().getActiveSheet()
30+
oCell = objActiveSheet.getCellByPosition(CellColumn, CellRow)
31+
ControlVal = oCell.Value
32+
33+
TC1 = Mid(ControlVal, 1, 1)
34+
TC2 = Mid(ControlVal, 2, 1)
35+
TC3 = Mid(ControlVal, 3, 1)
36+
TC4 = Mid(ControlVal, 4, 1)
37+
TC5 = Mid(ControlVal, 5, 1)
38+
TC6 = Mid(ControlVal, 6, 1)
39+
TC7 = Mid(ControlVal, 7, 1)
40+
TC8 = Mid(ControlVal, 8, 1)
41+
TC9 = Mid(ControlVal, 9, 1)
42+
TC10 = Mid(ControlVal, 10, 1)
43+
TC11 = Mid(ControlVal, 11, 1)
44+
45+
mod1 = ((((TC1 + TC3 + TC5 + TC7 + TC9) * 7) - (TC2 + TC4 + TC6 + TC8)) Mod 10)
46+
mod2 = ((TC1 + TC2 + TC3 + TC4 + TC5 + TC6 + TC7 + TC8 + TC9 + TC10) Mod 10)
47+
48+
If Len(ControlVal) &lt;&gt; 11 Then
49+
oCell.CharColor = RGB(255, 0, 0)
50+
Else
51+
If mod1 &lt;&gt; TC10 or mod2 &lt;&gt; TC11 Then
52+
oCell.CharColor = RGB(255, 0, 0)
53+
ElseIf TC11 mod(2) &lt;&gt; 0 Then
54+
oCell.CharColor = RGB(255, 0, 0)
55+
Else
56+
oCell.CharColor = RGB(0, 0, 0)
57+
End If
58+
End If
59+
End Function
60+
61+
62+
63+
Sub TcKimlikKontrol
64+
65+
66+
Dim i as integer
67+
Dim oCurrentController as variant
68+
Dim oActiveSheet as variant
69+
Dim oObj1 as variant
70+
Dim aRangeAddress as new com.sun.star.table.CellRangeAddress
71+
Dim nEndRow as long
72+
Dim target as string
73+
Dim colstr as string
74+
Dim rawstr as string
75+
76+
77+
P = &quot;TC Kimlik numaraları hangi s&#252;tunda bulunuyor?&quot;
78+
colstr = InputBox(P)
79+
P = &quot;TC Kimlik numaraları hangi satırdan itibaren bulunuyor?&quot;
80+
rawstr = InputBox(P)
81+
target = colstr + rawstr
82+
row =GetCellPositionRow(target)
83+
col =GetCellPositionColumn(target)
84+
85+
86+
87+
oCurrentController = ThisComponent.getCurrentController()
88+
oActiveSheet = oCurrentController.getActiveSheet()
89+
oObj1 = oActiveSheet.createCursor()
90+
91+
oObj1.gotoEndOfUsedArea(False)
92+
aRangeAddress = oObj1.getRangeAddress()
93+
nEndRow = aRangeAddress.EndRow
94+
95+
for i = row to nEndRow
96+
Control(i, col)
97+
next i
98+
99+
100+
End Sub
101+
102+
103+
</script:module>

TcNoControl/dialog.xlb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
3+
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="TcNoControl" library:readonly="false" library:passwordprotected="false">
4+
</library:library>

TcNoControl/script.xlb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
3+
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="TcNoControl" library:readonly="false" library:passwordprotected="false">
4+
<library:element library:name="TcControl"/>
5+
</library:library>

description.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<description xmlns="http://openoffice.org/extensions/description/2006"
3+
xmlns:d="http://openoffice.org/extensions/description/2006"
4+
xmlns:xlink="http://www.w3.org/1999/xlink">
5+
6+
<version value="0.1" />
7+
8+
<identifier value="com.bureken.TcKimlikNo" />
9+
10+
<platform value="all" />
11+
12+
<display-name>
13+
<name>Tc Kimlik No Kontrol</name>
14+
</display-name>
15+
16+
<publisher>
17+
<name xlink:href="http://www.berkgureken.com">Berk Gureken</name>
18+
</publisher>
19+
20+
<registration>
21+
<simple-license accept-by="admin" >
22+
<license-text xlink:href="pkg-desc/license.txt" />
23+
</simple-license>
24+
</registration>
25+
26+
</description>

0 commit comments

Comments
 (0)