[Libreoffice-commits] core.git: bin/rename-sw-abbreviations.sh

Jan Holesovsky kendy at collabora.com
Tue May 12 07:30:42 PDT 2015


 bin/rename-sw-abbreviations.sh |   43 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

New commits:
commit c4e59041660f10a5a410ec6930db3e524439e4d4
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue May 12 16:22:46 2015 +0200

    sw: Script to rename the most annoying abbrvs in Writer.
    
    Change-Id: I8d09d7f1a307cd5026fd007a2c82b21de925145e

diff --git a/bin/rename-sw-abbreviations.sh b/bin/rename-sw-abbreviations.sh
new file mode 100755
index 0000000..aea9604
--- /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:


More information about the Libreoffice-commits mailing list