[Libreoffice-commits] core.git: 2 commits - solenv/bin sw/source
Caolán McNamara
caolanm at redhat.com
Fri Sep 15 20:13:52 UTC 2017
solenv/bin/update-for-gettext | 76 ---------------------------
sw/source/uibase/uno/SwXDocumentSettings.cxx | 8 ++
2 files changed, 8 insertions(+), 76 deletions(-)
New commits:
commit 7bb6e01782d634cb6ee28623a01c5c75aae9b775
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 15 21:12:52 2017 +0100
update-for-gettext is no more now
Change-Id: I3da463ce2233512cb9b616fa75d7a07d9b32aeb5
diff --git a/solenv/bin/update-for-gettext b/solenv/bin/update-for-gettext
deleted file mode 100755
index 1234b248490f..000000000000
--- a/solenv/bin/update-for-gettext
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/python
-
-import binascii
-import polib
-from os import listdir, walk, remove
-from os.path import isdir, join
-
-import sys
-
-if len(sys.argv) < 2:
- print(" Syntax: update-for-gettext path/to/dir/of/languages")
- sys.exit(2)
-
-langs = [f for f in listdir(sys.argv[1]) if isdir(join(sys.argv[1], f))]
-
-uiline = False
-
-for lang in langs:
- path = join(sys.argv[1],lang)
- modules = [f for f in listdir(path) if isdir(join(path, f))]
- for module in modules:
- subpath = join(path, module)
- print >> sys.stderr, "module is", subpath, lang, module
- messages = None
- npos = 0
- for dirpath, dirname, filenames in walk(subpath):
- for filename in filenames:
- ipath = join(dirpath, filename)
- print >> sys.stderr, "file is", ipath
- po = polib.pofile(ipath)
- if len(po) != 0:
- samplefile = po[0].occurrences[0][0]
- if samplefile.endswith(".src") or samplefile.endswith(".ui"):
- if npos == 0:
- messages = po
- else:
- for entry in po:
- messages.append(entry)
- npos = npos + 1
- remove(ipath)
- if npos > 0:
- middle = 0
- for entry in messages:
- if not len(entry.occurrences):
- continue
- location = entry.occurrences[0][0]
- if location.endswith(".ui"):
- uiline = True
- else:
- uiline = False
- lines = entry.msgctxt.split('\n')
- if uiline:
- widgetid = lines[1]
- typeid = lines[2]
- entry.msgctxt = location[:-3] + "|" + widgetid
- if typeid == "tooltip_text":
- entry.msgctxt = entry.msgctxt + "|" + typeid
- if entry.msgctxt == 'calloutpage|position' and entry.msgid == 'Middle':
- middle = middle + 1
- if middle == 2:
- entry.msgid = "Center"
- else:
- ctxline = lines[1]
- if (ctxline.endswith("+RID_SC_FUNC_DESCRIPTIONS_START")):
- ctxline = ctxline[:-len("+RID_SC_FUNC_DESCRIPTIONS_START")]
- elif (ctxline.endswith("+RID_GLOBSTR_OFFSET")):
- ctxline = ctxline[:-len("+RID_GLOBSTR_OFFSET")]
- entry.msgctxt = ctxline
- comments = entry.comment.split('\n')
- keyid = entry.msgctxt + '|' + entry.msgid
- comments[-1] = polib.genKeyId(keyid.encode('utf-8'))
- entry.comment = "\n".join(comments)
- if lang != "templates":
- messages.save(join(subpath, "messages.po"))
- else:
- messages.save(join(subpath, "messages.pot"))
commit d2033373714ff1bb8a8808b702c85a8024f5a461
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 15 21:03:27 2017 +0100
survive disable-database-connectivity + docs with embedded database settings
Change-Id: I70c205cbff48844b645ace48bd6e001222f7855e
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index b96ca0dd8355..45a111c0b213 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_features.h>
+
#include <sal/config.h>
#include <utility>
@@ -506,9 +508,11 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_EMBEDDED_DATABASE_NAME:
{
+#if HAVE_FEATURE_DBCONNECTIVITY
OUString sEmbeddedName;
if (rValue >>= sEmbeddedName)
mpDoc->GetDBManager()->setEmbeddedName(sEmbeddedName, *mpDocSh);
+#endif
}
break;
case HANDLE_SAVE_VERSION_ON_CLOSE:
@@ -998,7 +1002,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_EMBEDDED_DATABASE_NAME:
{
+#if HAVE_FEATURE_DBCONNECTIVITY
rValue <<= mpDoc->GetDBManager()->getEmbeddedName();
+#else
+ rValue = uno::Any();
+#endif
}
break;
case HANDLE_SAVE_VERSION_ON_CLOSE:
More information about the Libreoffice-commits
mailing list