Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
7429ab2e
Kaydet (Commit)
7429ab2e
authored
Kas 19, 2012
tarafından
Zolnai Tamás
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use icu regex in l10ntools instead of i18nregexp
Change-Id: I9062aafa2fefa26b7b1edf0440f4675b2f469e5d
üst
c82935d5
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
65 additions
and
62 deletions
+65
-62
Executable_cfgex.mk
l10ntools/Executable_cfgex.mk
+5
-1
Executable_helpex.mk
l10ntools/Executable_helpex.mk
+2
-1
Executable_localize.mk
l10ntools/Executable_localize.mk
+5
-1
Executable_propex.mk
l10ntools/Executable_propex.mk
+5
-1
Executable_renewpo.mk
l10ntools/Executable_renewpo.mk
+5
-1
Executable_transex3.mk
l10ntools/Executable_transex3.mk
+5
-1
Executable_treex.mk
l10ntools/Executable_treex.mk
+2
-1
Executable_uiex.mk
l10ntools/Executable_uiex.mk
+2
-1
Executable_ulfex.mk
l10ntools/Executable_ulfex.mk
+5
-1
Executable_xrmex.mk
l10ntools/Executable_xrmex.mk
+2
-1
build.lst
l10ntools/prj/build.lst
+1
-1
po.cxx
l10ntools/source/po.cxx
+26
-51
No files found.
l10ntools/Executable_cfgex.mk
Dosyayı görüntüle @
7429ab2e
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,cfgex,\
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,cfgex,\
$(eval $(call gb_Executable_use_libraries,cfgex,\
$(eval $(call gb_Executable_use_libraries,cfgex,\
sal \
sal \
i18nregexp \
))
))
$(eval $(call gb_Executable_use_unpacked,cfgex,boost))
$(eval $(call gb_Executable_use_unpacked,cfgex,boost))
...
@@ -50,4 +49,9 @@ $(eval $(call gb_Executable_add_exception_objects,cfgex,\
...
@@ -50,4 +49,9 @@ $(eval $(call gb_Executable_add_exception_objects,cfgex,\
l10ntools/source/cfgmerge \
l10ntools/source/cfgmerge \
))
))
$(eval $(call gb_Executable_use_externals,cfgex,\
icuuc \
$(if $(filter MSC,$(COM)),icuin,icui18n) \
))
# vim:set shiftwidth=4 softtabstop=4 expandtab:
# vim:set shiftwidth=4 softtabstop=4 expandtab:
l10ntools/Executable_helpex.mk
Dosyayı görüntüle @
7429ab2e
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,helpex,\
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,helpex,\
$(eval $(call gb_Executable_use_libraries,helpex,\
$(eval $(call gb_Executable_use_libraries,helpex,\
sal \
sal \
i18nregexp \
))
))
$(eval $(call gb_Executable_use_external,helpex,expat_utf8))
$(eval $(call gb_Executable_use_external,helpex,expat_utf8))
...
@@ -51,6 +50,8 @@ $(eval $(call gb_Executable_add_exception_objects,helpex,\
...
@@ -51,6 +50,8 @@ $(eval $(call gb_Executable_add_exception_objects,helpex,\
$(eval $(call gb_Executable_use_externals,helpex,\
$(eval $(call gb_Executable_use_externals,helpex,\
libxml2 \
libxml2 \
icuuc \
$(if $(filter MSC,$(COM)),icuin,icui18n) \
))
))
# vim:set shiftwidth=4 softtabstop=4 expandtab:
# vim:set shiftwidth=4 softtabstop=4 expandtab:
l10ntools/Executable_localize.mk
Dosyayı görüntüle @
7429ab2e
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,localize,\
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,localize,\
$(eval $(call gb_Executable_use_libraries,localize,\
$(eval $(call gb_Executable_use_libraries,localize,\
sal \
sal \
i18nregexp \
))
))
$(eval $(call gb_Executable_use_static_libraries,localize,\
$(eval $(call gb_Executable_use_static_libraries,localize,\
...
@@ -44,4 +43,9 @@ $(eval $(call gb_Executable_add_exception_objects,localize,\
...
@@ -44,4 +43,9 @@ $(eval $(call gb_Executable_add_exception_objects,localize,\
l10ntools/source/localize \
l10ntools/source/localize \
))
))
$(eval $(call gb_Executable_use_externals,localize,\
icuuc \
$(if $(filter MSC,$(COM)),icuin,icui18n) \
))
# vim:set shiftwidth=4 softtabstop=4 expandtab:
# vim:set shiftwidth=4 softtabstop=4 expandtab:
l10ntools/Executable_propex.mk
Dosyayı görüntüle @
7429ab2e
...
@@ -17,7 +17,6 @@ $(eval $(call gb_Executable_set_include,propex,\
...
@@ -17,7 +17,6 @@ $(eval $(call gb_Executable_set_include,propex,\
$(eval $(call gb_Executable_use_libraries,propex,\
$(eval $(call gb_Executable_use_libraries,propex,\
sal \
sal \
i18nregexp \
))
))
$(eval $(call gb_Executable_use_static_libraries,propex,\
$(eval $(call gb_Executable_use_static_libraries,propex,\
...
@@ -29,4 +28,9 @@ $(eval $(call gb_Executable_add_exception_objects,propex,\
...
@@ -29,4 +28,9 @@ $(eval $(call gb_Executable_add_exception_objects,propex,\
l10ntools/source/propex \
l10ntools/source/propex \
))
))
$(eval $(call gb_Executable_use_externals,propex,\
icuuc \
$(if $(filter MSC,$(COM)),icuin,icui18n) \
))
# vim: set noet sw=4 ts=4:
# vim: set noet sw=4 ts=4:
l10ntools/Executable_renewpo.mk
Dosyayı görüntüle @
7429ab2e
...
@@ -18,7 +18,6 @@ $(eval $(call gb_Executable_set_include,renewpo,\
...
@@ -18,7 +18,6 @@ $(eval $(call gb_Executable_set_include,renewpo,\
$(eval $(call gb_Executable_use_libraries,renewpo,\
$(eval $(call gb_Executable_use_libraries,renewpo,\
sal \
sal \
i18nregexp \
))
))
$(eval $(call gb_Executable_use_static_libraries,renewpo,\
$(eval $(call gb_Executable_use_static_libraries,renewpo,\
...
@@ -29,4 +28,9 @@ $(eval $(call gb_Executable_add_exception_objects,renewpo,\
...
@@ -29,4 +28,9 @@ $(eval $(call gb_Executable_add_exception_objects,renewpo,\
l10ntools/source/renewpo \
l10ntools/source/renewpo \
))
))
$(eval $(call gb_Executable_use_externals,renewpo,\
icuuc \
$(if $(filter MSC,$(COM)),icuin,icui18n) \
))
# vim: set noet sw=4 ts=4:
# vim: set noet sw=4 ts=4:
l10ntools/Executable_transex3.mk
Dosyayı görüntüle @
7429ab2e
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,transex3,\
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,transex3,\
$(eval $(call gb_Executable_use_libraries,transex3,\
$(eval $(call gb_Executable_use_libraries,transex3,\
sal \
sal \
i18nregexp \
))
))
$(eval $(call gb_Executable_add_scanners,transex3,\
$(eval $(call gb_Executable_add_scanners,transex3,\
...
@@ -50,4 +49,9 @@ $(eval $(call gb_Executable_add_exception_objects,transex3,\
...
@@ -50,4 +49,9 @@ $(eval $(call gb_Executable_add_exception_objects,transex3,\
l10ntools/source/export \
l10ntools/source/export \
))
))
$(eval $(call gb_Executable_use_externals,transex3,\
icuuc \
$(if $(filter MSC,$(COM)),icuin,icui18n) \
))
# vim:set shiftwidth=4 softtabstop=4 expandtab:
# vim:set shiftwidth=4 softtabstop=4 expandtab:
l10ntools/Executable_treex.mk
Dosyayı görüntüle @
7429ab2e
...
@@ -17,7 +17,6 @@ $(eval $(call gb_Executable_set_include,treex,\
...
@@ -17,7 +17,6 @@ $(eval $(call gb_Executable_set_include,treex,\
$(eval $(call gb_Executable_use_libraries,treex,\
$(eval $(call gb_Executable_use_libraries,treex,\
sal \
sal \
i18nregexp \
))
))
$(eval $(call gb_Executable_use_static_libraries,treex,\
$(eval $(call gb_Executable_use_static_libraries,treex,\
...
@@ -31,6 +30,8 @@ $(eval $(call gb_Executable_add_exception_objects,treex,\
...
@@ -31,6 +30,8 @@ $(eval $(call gb_Executable_add_exception_objects,treex,\
$(eval $(call gb_Executable_use_externals,treex,\
$(eval $(call gb_Executable_use_externals,treex,\
libxml2 \
libxml2 \
icuuc \
$(if $(filter MSC,$(COM)),icuin,icui18n) \
))
))
# vim: set noet sw=4 ts=4:
# vim: set noet sw=4 ts=4:
l10ntools/Executable_uiex.mk
Dosyayı görüntüle @
7429ab2e
...
@@ -16,7 +16,6 @@ $(eval $(call gb_Executable_set_include,uiex,\
...
@@ -16,7 +16,6 @@ $(eval $(call gb_Executable_set_include,uiex,\
$(eval $(call gb_Executable_use_libraries,uiex,\
$(eval $(call gb_Executable_use_libraries,uiex,\
sal \
sal \
i18nregexp \
))
))
$(eval $(call gb_Executable_use_unpacked,uiex,boost))
$(eval $(call gb_Executable_use_unpacked,uiex,boost))
...
@@ -33,6 +32,8 @@ $(eval $(call gb_Executable_use_externals,uiex,\
...
@@ -33,6 +32,8 @@ $(eval $(call gb_Executable_use_externals,uiex,\
libexslt \
libexslt \
libxml2 \
libxml2 \
libxslt \
libxslt \
icuuc \
$(if $(filter MSC,$(COM)),icuin,icui18n) \
))
))
# vim: set noet sw=4 ts=4:
# vim: set noet sw=4 ts=4:
l10ntools/Executable_ulfex.mk
Dosyayı görüntüle @
7429ab2e
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,ulfex,\
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,ulfex,\
$(eval $(call gb_Executable_use_libraries,ulfex,\
$(eval $(call gb_Executable_use_libraries,ulfex,\
sal \
sal \
i18nregexp \
))
))
$(eval $(call gb_Executable_use_unpacked,ulfex,boost))
$(eval $(call gb_Executable_use_unpacked,ulfex,boost))
...
@@ -47,4 +46,9 @@ $(eval $(call gb_Executable_add_exception_objects,ulfex,\
...
@@ -47,4 +46,9 @@ $(eval $(call gb_Executable_add_exception_objects,ulfex,\
l10ntools/source/lngex \
l10ntools/source/lngex \
))
))
$(eval $(call gb_Executable_use_externals,ulfex,\
icuuc \
$(if $(filter MSC,$(COM)),icuin,icui18n) \
))
# vim:set shiftwidth=4 softtabstop=4 expandtab:
# vim:set shiftwidth=4 softtabstop=4 expandtab:
l10ntools/Executable_xrmex.mk
Dosyayı görüntüle @
7429ab2e
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,xrmex,\
...
@@ -33,7 +33,6 @@ $(eval $(call gb_Executable_set_include,xrmex,\
$(eval $(call gb_Executable_use_libraries,xrmex,\
$(eval $(call gb_Executable_use_libraries,xrmex,\
sal \
sal \
i18nregexp \
))
))
$(eval $(call gb_Executable_use_unpacked,xrmex,boost))
$(eval $(call gb_Executable_use_unpacked,xrmex,boost))
...
@@ -52,6 +51,8 @@ $(eval $(call gb_Executable_add_exception_objects,xrmex,\
...
@@ -52,6 +51,8 @@ $(eval $(call gb_Executable_add_exception_objects,xrmex,\
$(eval $(call gb_Executable_use_externals,xrmex,\
$(eval $(call gb_Executable_use_externals,xrmex,\
libxml2 \
libxml2 \
icuuc \
$(if $(filter MSC,$(COM)),icuin,icui18n) \
))
))
# vim:set shiftwidth=4 softtabstop=4 expandtab:
# vim:set shiftwidth=4 softtabstop=4 expandtab:
l10ntools/prj/build.lst
Dosyayı görüntüle @
7429ab2e
tr l10ntools : EXPAT:expat LIBXSLT:libxslt
sal regexp
NULL
tr l10ntools : EXPAT:expat LIBXSLT:libxslt
ICU:icu sal
NULL
tr l10ntools usr1 - all tr_mkout NULL
tr l10ntools usr1 - all tr_mkout NULL
tr l10ntools\prj nmake - all tr_prj NULL
tr l10ntools\prj nmake - all tr_prj NULL
l10ntools/source/po.cxx
Dosyayı görüntüle @
7429ab2e
...
@@ -7,10 +7,6 @@
...
@@ -7,10 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
*/
#include <com/sun/star/util/SearchOptions.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/i18n/XExtendedTransliteration.hpp>
#include <regexp/reclass.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
#include <cstring>
#include <cstring>
...
@@ -21,12 +17,15 @@
...
@@ -21,12 +17,15 @@
#include <string>
#include <string>
#include <boost/crc.hpp>
#include <boost/crc.hpp>
#include <unicode/regex.h>
#include "po.hxx"
#include "po.hxx"
#define POESCAPED OString("\\n\\t\\r\\\\\\\"")
#define POESCAPED OString("\\n\\t\\r\\\\\\\"")
#define POUNESCAPED OString("\n\t\r\\\"")
#define POUNESCAPED OString("\n\t\r\\\"")
using
namespace
U_ICU_NAMESPACE
;
//Class GenPoEntry
//Class GenPoEntry
class
GenPoEntry
class
GenPoEntry
...
@@ -317,61 +316,37 @@ namespace
...
@@ -317,61 +316,37 @@ namespace
return
lcl_UnEscapeText
(
rText
,
"
\\
n
\\
t
\\
r"
,
"
\n\t\r
"
);
return
lcl_UnEscapeText
(
rText
,
"
\\
n
\\
t
\\
r"
,
"
\n\t\r
"
);
}
}
//Miminize the length of the regular expression result
static
void
lcl_Minimize
(
const
OUString
&
rText
,
Regexpr
&
io_rRegExp
,
re_registers
&
io_rRegs
)
{
re_registers
aPrevRegs
;
const
sal_Int32
nStart
=
io_rRegs
.
start
[
0
];
do
{
const
OUString
sTemp
=
rText
.
copy
(
0
,
io_rRegs
.
end
[
0
]
-
1
);
memcpy
(
static_cast
<
void
*>
(
&
aPrevRegs
),
static_cast
<
void
*>
(
&
io_rRegs
),
sizeof
(
re_registers
));
memset
(
static_cast
<
void
*>
(
&
io_rRegs
),
0
,
sizeof
(
re_registers
));
io_rRegExp
.
set_line
(
sTemp
.
getStr
(),
sTemp
.
getLength
());
io_rRegExp
.
re_search
(
&
io_rRegs
,
nStart
);
}
while
(
io_rRegs
.
num_of_match
);
memcpy
(
static_cast
<
void
*>
(
&
io_rRegs
),
static_cast
<
void
*>
(
&
aPrevRegs
),
sizeof
(
re_registers
));
io_rRegExp
.
set_line
(
rText
.
getStr
(),
rText
.
getLength
());
}
//Find all special tag in a string using a regular expression
//Find all special tag in a string using a regular expression
static
void
lcl_FindAllTag
(
static
void
lcl_FindAllTag
(
const
OString
&
rText
,
std
::
vector
<
OString
>&
o_vFoundTags
)
const
OString
&
rText
,
std
::
vector
<
OString
>&
o_vFoundTags
)
{
{
::
com
::
sun
::
star
::
util
::
SearchOptions
aOptions
;
aOptions
.
algorithmType
=
UErrorCode
nIcuErr
=
U_ZERO_ERROR
;
::
com
::
sun
::
star
::
util
::
SearchAlgorithms_REGEXP
;
sal_uInt32
nSearchFlags
=
UREGEX_DOTALL
|
UREGEX_CASE_INSENSITIVE
;
aOptions
.
searchFlag
=
OUString
sLocaleText
(
OStringToOUString
(
rText
,
RTL_TEXTENCODING_UTF8
)
);
::
com
::
sun
::
star
::
util
::
SearchFlags
::
NORM_WORD_ONLY
;
OUString
sPattern
(
"<[/]??[a-z_-]+?(?:| +[a-z]+?=
\"
.*?
\"
) *[/]??>"
);
aOptions
.
searchString
=
"<[/]?[a-z_
\\
-]+(| +[a-z]+=
\"
.*
\"
) *[/]?>"
;
UnicodeString
sSearchPat
(
::
com
::
sun
::
star
::
uno
::
Reference
<
reinterpret_cast
<
const
UChar
*>
(
::
com
::
sun
::
star
::
i18n
::
XExtendedTransliteration
>
xTrans
;
sPattern
.
getStr
()),
sPattern
.
getLength
()
);
UnicodeString
sSource
(
Regexpr
aRegExp
(
aOptions
,
xTrans
);
reinterpret_cast
<
const
UChar
*>
(
const
OUString
sTemp
(
OStringToOUString
(
rText
,
RTL_TEXTENCODING_UTF8
));
sLocaleText
.
getStr
()),
sLocaleText
.
getLength
()
);
aRegExp
.
set_line
(
sTemp
.
getStr
(),
sTemp
.
getLength
());
RegexMatcher
aRegexMatcher
(
sSearchPat
,
nSearchFlags
,
nIcuErr
);
re_registers
aRegs
;
aRegexMatcher
.
reset
(
sSource
);
memset
(
static_cast
<
void
*>
(
&
aRegs
),
0
,
sizeof
(
re_registers
));
int64_t
nStartPos
=
0
;
sal_Int32
nStart
=
0
;
while
(
aRegexMatcher
.
find
(
nStartPos
,
nIcuErr
)
&&
o_vFoundTags
.
resize
(
0
);
nIcuErr
==
U_ZERO_ERROR
)
aRegExp
.
re_search
(
&
aRegs
,
nStart
);
while
(
aRegs
.
num_of_match
)
{
{
lcl_Minimize
(
sTemp
,
aRegExp
,
aRegs
);
UnicodeString
sMatch
=
aRegexMatcher
.
group
(
nIcuErr
);
o_vFoundTags
.
push_back
(
o_vFoundTags
.
push_back
(
OUStringToOString
(
OUStringToOString
(
sTemp
.
copy
(
aRegs
.
start
[
0
],
aRegs
.
end
[
0
]
-
aRegs
.
start
[
0
]),
OUString
(
reinterpret_cast
<
const
sal_Unicode
*>
(
sMatch
.
getBuffer
()),
sMatch
.
length
()),
RTL_TEXTENCODING_UTF8
));
RTL_TEXTENCODING_UTF8
));
nStart
=
aRegs
.
end
[
0
];
nStartPos
=
aRegexMatcher
.
start
(
nIcuErr
)
+
1
;
memset
(
static_cast
<
void
*>
(
&
aRegs
),
0
,
sizeof
(
re_registers
));
aRegExp
.
re_search
(
&
aRegs
,
nStart
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment