summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-05-12 16:22:46 +0200
committerJan Holesovsky <kendy@collabora.com>2015-05-12 16:28:22 +0200
commitc4e59041660f10a5a410ec6930db3e524439e4d4 (patch)
treef71aa9d7cf21b244282e6b69eaa091886f0f1bde /bin
parent2a2a180d610eb92a6d856336527f3f8388244832 (diff)
sw: Script to rename the most annoying abbrvs in Writer.
Change-Id: I8d09d7f1a307cd5026fd007a2c82b21de925145e
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rename-sw-abbreviations.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/bin/rename-sw-abbreviations.sh b/bin/rename-sw-abbreviations.sh
new file mode 100755
index 000000000000..aea96045583a
--- /dev/null
+++ b/bin/rename-sw-abbreviations.sh
@@ -0,0 +1,43 @@
+#! /bin/bash
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# This script renames the most annoying abbreviations in Writer (and partially
+# in the shared code too). Just run it in the source directory.
+
+# sw only:
+
+for I in "FrmFmt/FrameFormat" "Fmt/Format" "Cntnt/Content" "Txt/Text" "Tbl/Table" "GotoFld/GotoFormatField" "Fld/Field" "Ftn/Footnote" "Updt/Update" "Fml/Formula" "Hnt/Hint"
+do
+ S="${I%/*}"
+ # change all except the filenames (in the .mk and in #include)
+ # also avoid XML_numFmt, that's a token name
+ git grep -l "$S" sw/ | grep -v '\.mk' | xargs sed -i '/\(#include\|XML_numFmt\)/ !{ s/'"$I"'/g }'
+done
+
+# global:
+
+for I in "SvxSwAutoFmtFlags/SvxSwAutoFormatFlags" "GetCharFmtName/GetCharFormatName" \
+ "SvxFmtBreakItem/SvxFormatBreakItem" "SvxFmtKeepItem/SvxFormatKeepItem" \
+ "SvxFmtSplitItem/SvxFormatSplitItem" "etTxtLeft/etTextLeft" \
+ "etTxtFirstLineOfst/etTextFirstLineOfst" "CntntProtected/ContentProtected" \
+ "etTxtColor/etTextColor" "ClearFldColor/ClearFieldColor" \
+ "etCntntProtect/etContentProtect" "etPropTxtFirstLineOfst/etPropTextFirstLineOfst" \
+ "etCharFmtName/etCharFormatName" "HasMergeFmtTbl/HasMergeFormatTable" \
+ "etMergeFmtIndex/etMergeFormatIndex" "bAFmtByInput/bAFormatByInput" \
+ "bAFmt/bAFormat" "IsTxtFmt/IsTextFormat" "BuildWhichTbl/BuildWhichTable" \
+ "etFld/etField" "IsAutoFmtByInput/IsAutoFormatByInput" \
+ "etAutoFmtByInput/etAutoFormatByInput" "etMacroTbl/etMacroTable" \
+ "SvxClipboardFmtItem/SvxClipboardFormatItem" "SwFlyFrmFmt/SwFlyFrameFormat" \
+ "etTxtSize/etTextSize"
+do
+ S="${I%/*}"
+ git grep -l "$S" | grep -v '\.mk' | xargs sed -i "s/$I/g"
+done
+
+# vim: set noet sw=4 ts=4: