Commit Graph

583 Commits

Author SHA1 Message Date
e67c21ee06 Search for char instead of 1 char long string, when possible.
follow-up of a7674482254ee996b1c4fee60f3064778be369aa

Change-Id: I25f40c601454c092078307d931333af1bc1447ac
2013-06-29 09:53:41 +02:00
b55289659a fdo#66048: export cannot handle starting \\\"
Old stuff. By now we always have to add double
quotes to the edges of text.

Change-Id: I14ca7283d723bf87fb232288d92e53393e90103e
2013-06-22 19:01:51 +02:00
47a23789b7 l10ntools: getLength() -> isEmpty()
Change-Id: I9272c244e22d87fbd2547f4fcb6b94493ffaad3a
2013-06-17 13:06:57 +02:00
58a9d35b84 fdo#65483 Invalid po lines caused missing translations
L10ntools merge skipped reading po files entirely when got
an invalid entry from one of these po files, by now just
skip the invalid po file instead.

Change-Id: I787d531e1842e53e2074690b1300a204abd928f5
2013-06-11 11:37:53 +02:00
788a38fd32 Better verification of bad idxdict input
...see dictionaries comits df423c53829faa96f46acd71887fd0f8697c49e9
"fix Lithuanian thesaurus" and 9b6407dadc64e10e7117d8551917b46105ecc6c8
"Fix more thesauri."

Change-Id: I6ddc41fce4e3f68d80d05af3320c835b98908fcb
2013-05-28 14:30:45 +02:00
e39e9e4cd8 Source files shouldn't have executable bit set.
Change-Id: Iafad6249a7998d7c749c1ca2979a606078cfcb5e
Reviewed-on: https://gerrit.libreoffice.org/4070
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-05-28 12:09:27 +00:00
1cb50dc6ec Escape quotes during stringex export
Change-Id: If53afd3743f44bcfffab33122657d14c0f4aba1e
2013-05-26 08:57:48 +02:00
f21a2374dc Fix some escaping bug in l10ntools
1. A typo in export.cxx makes not working replacing
2. EscapeAll() ignored single backlash characters

Change-Id: I1a5309778acdd601391f643ebf3c66d04a6601d4
2013-05-25 22:23:57 +02:00
2ae6f9d1d2 RHEL-5 baseline ver of flex doesn't have nounistd
lets try this hack, if it fails revert and I'll just
manually update the baseline with a newer flex than
flex-2.5.4a-41.fc6

Change-Id: If644489e80fc4e4cdba97808af0fe4d544d08646
2013-05-23 13:57:20 +01:00
99f7690bee gallery: cleanup makefiles for new gallery naming and translation.
Change-Id: I9ec5192c007df6d0ce15f5e61cb53cf6ea04db08
2013-05-15 09:37:41 +01:00
e347af862c typo fix: s/inavlid/invalid/
Change-Id: If75cad038f35033be6dcad6f051673bd795accf3
2013-05-14 15:52:24 +02:00
f9bb8a6da4 fixed transex3 out of bounds access to vMergeEntryVector
transex3 crashed if a new language was added to the StringArray
PairedList in svtools/source/misc/langtab.src and that resource was
attempted to be built.

For the new entry doesn't exist a MergeEntrys entry in vMergeEntryVector
yet, but ExportList::GetSourceLanguageListEntryCount() already includes
it so nMaxList is greater than size of vMergeEntryVector. Check nLIndex
first.

Change-Id: I3b706bea7aea7cd7ecd8245d99587b944510952d
2013-05-11 01:56:36 +02:00
09373d4583 soltools: remove Package_inc and empty unistd.h nonsense
Change-Id: Ic05de69951b28b9cc8d62f0a534b507c424e6b25
2013-05-10 17:56:24 +02:00
9210f1a50a coverity#1019372/373: Resource leaks
Change-Id: I8d1facfa027701a4f249f14392f9b204e92180be
2013-05-08 20:53:55 +02:00
6bd878b29f coverity#1019374: Resource leak
Change-Id: If558758e3315879adf3034038f7ebe7315baf7a6
2013-05-08 20:49:37 +02:00
02beb61475 coverity#982460: Explicit null dereferenced
Change-Id: I64d559603bff0d618dce72927566531296984d3c
Reviewed-on: https://gerrit.libreoffice.org/3823
Reviewed-by: Noel Power <noel.power@suse.com>
Tested-by: Noel Power <noel.power@suse.com>
2013-05-08 08:40:07 +00:00
520fd4968d WaE: unused parameter 'rOpenTag'
Change-Id: I515a316bea0bef6608d993823f906390b39e9fa9
2013-05-02 19:25:42 +03:00
f6626720d5 Fix warning: unused variable 'sLang' [loplugin]
Change-Id: I0cf95c5ef222d085ccda73b54165d7238190becc
2013-05-02 19:24:20 +03:00
29400c568a Some code scrubing
Add doxygen documentation for classes and methods
Delete useless comments.
Add include guards where missing.
Delete some useless typedef.

Change-Id: I9bba16560790239d7775fcd40981465e70e5d437
2013-05-02 15:48:30 +02:00
c7ef252227 Make localization a bit more effective
1. get rid of some unefficiency
The "old" executables used to parse items which has
other language than en-US. To this items executables
search MergeEntrys(read from po) and change the content if
possible. This mixed localization method not need any longer.
-cfgex: cfgmerge:WorkOnText()
-xrmex: xrmmerge:WorkOnText()
-transex3: export:PrepareTextToMerge()

2. Change the container of MergeData to get a bit efficiency.
The new MergeDataHashMap is exploit that in most case the
insertion and search happen in the same order.(similar to fifo)
So add an iterator-chain to define an insertion order in the
original hashmap.
Every call of find it is a hint that the next element, to
the last found one, is the searched one. If not than search
such like in a HasMap.

3. Set up some order in helpex
Helpex is the only one, which was not used to merge strings
in the same order as export, so change it to work effective
with the new HashMap.
Helpex works with all file of a specific directory and po
files contain the strings of these files in lexical order
 so use the same order for merge.(HelpTarget.mk)

4. Make export use MergeDataHashMap a bit more effective
-The same MergeData contains strings to all language,
so it need to get only once.
-Just text entrys have MergeData, others not need to
search for it. (e.g. bitmap)

Plus delete some unused code.

Change-Id: I6ec80cd2323ffea8f783d0b59dc89ca7eac3c205
2013-05-02 12:15:22 +02:00
72e5d0c8fb Move to MPLv2 license headers, with ESC decision and author's permission. 2013-04-30 13:34:06 +01:00
f167f03735 L10ntools: remove some lang vectors from parsing
Change-Id: I3b9ef50d8e0c1e99d5b535d95a5add90a1cbaf03
2013-04-23 23:52:54 +02:00
2d8e4f91fe Delete more unused member from export
Change-Id: Icebd32c7ac2144f99827ca48cca7bbcaf10814c4
2013-04-21 19:10:09 +02:00
36b3bcefcf Some changes in qtz handling
Executalbes, which work one language, generat qtz by own.
(stringex,helpex,treex,propex)
So these executables can generate qtz without po file
when use them with qtz, call them with "-m" flag without parameter.

Change-Id: I56c34db7151dc3ef0ce1c85ed607719e4cbb5e92
2013-04-21 18:57:17 +02:00
9e2d282206 Delete some unneeded member of ResData
nChildIndex and bRestMerges are simple unused.
nWidth is an obsolote attribute

Change-Id: I669a17cefb3dc8628ce2c8d9db8abac630fc3cde
2013-04-20 09:48:29 +02:00
10e3c7c428 Delete remaind code of an obsolote parameter
Past: Use "-l en-US, af, hu..." parameter for transex
and to work with this string use InitLanguages() function.
Now: Use "-l all" parameter and get langauges from po files.
So InitLanguages is unneeded.

Change-Id: Ide6b3d24fb8b483c0c31034b1ffd6aba31c5e4c9
2013-04-15 18:02:02 +02:00
41807e779f Fix warning: unused variable 'sPlatform' [loplugin]
Change-Id: I2d6c7bae4f202a00f89d22b63370c128cc27c7c4
2013-04-13 14:21:36 +03:00
1e53d3b87a Revert "KeyId do not contain special chars so ulfex can use it again"
This reverts commit 8287da2fbc09882893642b7a6e3ca555b2b956b3.
2013-04-13 10:22:49 +02:00
336e04496f Some empty pot directories remained
Change-Id: I5aedd4595c3f676deaedddf80c3a96250015f2ed
2013-04-13 09:28:18 +02:00
8287da2fbc KeyId do not contain special chars so ulfex can use it again
Change-Id: Icfb581ac2771df39c71ad12f94dba5d51f3c4ec5
2013-04-13 09:07:15 +02:00
4146406205 l10ntools: export use only en-US
So no need to ad it in a commandline parameter.
No need to use a vector to store languages.

Change-Id: I1f7d3bd131b5a9ff23d403cee4ac6804ae8e0a0b
2013-04-13 07:22:22 +02:00
5acc994f4e Remove obsolote 'empty string -> "-"' behaviour
Change-Id: I1d81d4c5716c397b84c0a8959b21beacbbbf1138
2013-04-13 06:37:05 +02:00
be30e0e139 Delete obsolote platform from l10ntools merge
Change-Id: I5e5b87355d3d6e369c8fccd7078581758abb3b10
2013-04-13 06:02:21 +02:00
d885a85a48 Make l10ntools executables escape clear
Steps of escaping process:
1. Executables unescape the string for export(if necessary)
2. Po class work with unescaped string
3. Escape strings to PO format and write out
4. Read from PO and unescape strings
5. Executables make own transformation on string and merge

Use general functions for escaping (helper)
Delete unneeded escaping methods(xrmmerge, merge)
Delete some unused method from PoEntry class

Change-Id: I7f9414581aae9e6de7d1573862a32cdbd68c9545
2013-04-13 05:44:02 +02:00
1946794ae0 mass removal of rtl:: prefixes for O(U)String*
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk
have kept them, in order not to break external API (the automatic using declaration
is LO-internal).

Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2013-04-07 14:23:11 +02:00
68c72dfb9d Fix assertion in xmlparse and call this function with more care
Plus change range to [nStart,nEnd).

Change-Id: I1570d07fdc90a6b2bdf3eef7914958212cbbaa87
2013-04-02 16:21:31 +02:00
a47e50e338 Prevent asserts from firing
...whether or not this is already the correct fix.  The twisted
nEndPos/nStartPos arguments in the calls to lcl_QuotRange look somewhat odd.

Change-Id: If22afb058012c830b5aa6d059c7df0b4e9c53696
2013-04-02 08:48:48 +02:00
c4745302f3 There is no <Arg> tag in xcu localizable strings
So no reason to work with it.
So can use helper function after
make it to handle single quote.

Change-Id: Ic2eb901148c3ae31316607b41350bbad79a639db
2013-03-31 22:10:55 +02:00
ce51bf1a6e Make a bit cleaner transformation of help strings
*Not escape tags and double quots in tags,
 but find tags(icu regexp) when merge and
 use this infromation to make strings valid.
*Define a new Quot function for helpex,
 which works with icu UnicodeCharacter.
*Move tag search to xmlparse.cxx and use icu
 just in helpex.
*QuotHTML not unescape just replace xml charcters.
 (unescaping is also useless in uimerge.cxx)
*Move UnQuotHTML() to helper.
 (was used it in xmlparse.cxx and cfgmerge.cxx)
*Use UnQuotHTML() in uimerge.cxx too.

Change-Id: Ice8940ef69279709a1c5d84c6ae1b0d62a71ca76
2013-03-31 20:25:13 +02:00
7eaf1e9388 Half-assed attempt at enforcing operator [] preconditions
...inspired by comments to <https://gerrit.libreoffice.org/#/c/3068/>
"String::AppendAscii cleanup in dbaccess," but it quickly becomes apparent that
lots of code rely on s[s.getLength()] == 0, so live with a weakened precondition
check for now.

Change-Id: Ifad96c706b14433df4a084ab8054b32433b8b5b6
2013-03-28 13:30:41 +01:00
d7e6a24f16 Fix build: typo and not need
Change-Id: I7bc1ee815e6ac333fb0c5b9a2c3135db2f81235e
2013-03-27 21:39:07 +01:00
e0cf3babee -Werror,-Wunused-private-field
Change-Id: I42235ca7cd25c07af7daaf51f56a6deb60e4108e
2013-03-27 21:16:27 +01:00
8e26b4783f Refactor l10ntools
Delete unused functions.
Make Export class more encapsulated.
Move to local that functions which are used only in one file.
Common contans method which are used by all executables.
Helper contains methods belong to xml parsing.

Change-Id: I28773a2c7eea90da7df7f32720fd38de2cb661ac
2013-03-27 20:09:31 +01:00
aa753f01ba -Wunused-macros
Change-Id: Ifaa1637122d6f9cae1e29b77ac36ca5d1f220aed
2013-03-27 09:36:53 +01:00
6ecf41eb2d Typo __SINPRO_CC -> __SUNPRO_CC
Change-Id: I831abe80f9b4b160f4af10a16f4d45cc68fa3bb6
2013-03-26 17:21:47 +01:00
56a52889e6 Remove unneeded project and projectroot parameters
Plus avoid use of Export::sLanguages member outside
of the class.

Change-Id: I33702816fdb4980d690cfe8fcd8cc3fbd0df1dd8
2013-03-25 12:01:59 +01:00
fa545023ad Introduce HAVE_GCC_PRAGMA_DIAGNOSTIC_{MODIFY,SCOPE}
...replacing hard-coded GCC version checks.  Those checks that guard

  #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"

appear relevant only for GCC itself, not Clang (which used to fail the old
guards because it typically announces itself with a rather low
__GNUC__/__GNUC_MINOR__ version), see 6e67c03dc0225fc66343546b14e902b9d238b1a3
"Enable -Wnon-virtual-dtor for GCC 4.6"

Change-Id: I6bfa4d5caa6192e7a203ce829682bf6bb8d61a1b
2013-03-25 08:52:54 +01:00
843b7b614e qtz length changed, use this length dynamically
Change-Id: I2935ff0c1114f1b3e690fd6f86441a180566fd32
2013-03-24 01:07:51 +01:00
0552b4334c Check return value of system()
Change-Id: I1b9e31b8c64ed8bf7eb073f036a7fdda39a15392
2013-03-22 08:17:03 +01:00
9d64e7f2b7 These classes are not used
Classes with same function: osl::Directory, osl::File

Change-Id: I0e8d18bab6ee244da274c733b8f1f646897afc7d
2013-03-19 23:25:58 +01:00