[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: [calligra] /: Variables: Made file-name work + enable access to file-name, keywords and comments.
From: Sebastian Sauer <sebastian.sauer () kdab ! com>
Date: 2012-01-27 6:38:48
Message-ID: 20120127063848.3B427A60C8 () git ! kde ! org
[Download RAW message or body]
Git commit 3c54f5cd24cc3c5ebd6240070cc091783ca7fcb2 by Sebastian Sauer.
Committed on 27/01/2012 at 07:22.
Pushed by sebsauer into branch 'master'.
Variables: Made file-name work + enable access to file-name, keywords and \
comments. This fixes the missing url in the footer at the docx from \
http://www.pro-linux.de/artikel/2/1553/ooxml-und-freie-textverarbeitungsprogramme.html
@i18n: Asking for approval to introduce these new 3 strings to enable \
access to 3 basic functions in Words/Stage/Tables. \
CCMAIL:kde-i18n-doc@kde.org
M +1 -0 libs/kotext/KoInlineObject.h
M +2 -0 libs/kotext/KoInlineTextObjectManager.cpp
M +9 -1 plugins/variables/InfoVariable.cpp
M +24 -0 plugins/variables/InfoVariableFactory.cpp
http://commits.kde.org/calligra/3c54f5cd24cc3c5ebd6240070cc091783ca7fcb2
diff --git a/libs/kotext/KoInlineObject.h b/libs/kotext/KoInlineObject.h
index a2aae3e..8a1d627 100644
--- a/libs/kotext/KoInlineObject.h
+++ b/libs/kotext/KoInlineObject.h
@@ -65,6 +65,7 @@ public:
Keywords,
Subject,
Description,
+ Comments,
SenderPostalCode,
SenderCity,
SenderStreet,
diff --git a/libs/kotext/KoInlineTextObjectManager.cpp \
b/libs/kotext/KoInlineTextObjectManager.cpp index c302b6c..5465148 100644
--- a/libs/kotext/KoInlineTextObjectManager.cpp
+++ b/libs/kotext/KoInlineTextObjectManager.cpp
@@ -291,6 +291,8 @@ void \
KoInlineTextObjectManager::documentInformationUpdated(const QString &info, \
setProperty(KoInlineObject::Title, data); else if (info == "description")
setProperty(KoInlineObject::Description, data);
+ else if (info == "comments")
+ setProperty(KoInlineObject::Comments, data);
else if (info == "subject")
setProperty(KoInlineObject::Subject, data);
else if (info == "keyword")
diff --git a/plugins/variables/InfoVariable.cpp \
b/plugins/variables/InfoVariable.cpp index 3a172dd..a74ae9a 100644
--- a/plugins/variables/InfoVariable.cpp
+++ b/plugins/variables/InfoVariable.cpp
@@ -38,7 +38,8 @@ static const struct {
{ KoInlineObject::Title, "title", "text:title" },
{ KoInlineObject::Subject, "subject", "text:subject" },
{ KoInlineObject::Keywords, "keywords", "text:keywords" },
- { KoInlineObject::Description, "description", "text:description" }
+ //{ KoInlineObject::Description, "description", "text:description" }
+ { KoInlineObject::Comments, "comments", "text:comments" }
};
static const unsigned int numPropertyData = sizeof(propertyData) / \
sizeof(*propertyData); @@ -104,5 +105,12 @@ bool \
InfoVariable::loadOdf(const KoXmlElement & element, KoShapeLoadingContext & \
const QString localName(element.localName()); m_type = \
s_loadInfo->value(localName);
+ for(KoXmlNode node = element.firstChild(); !node.isNull(); node = \
node.nextSibling() ) { + if (node.isText()) {
+ setValue(node.toText().data());
+ break;
+ }
+ }
+
return true;
}
diff --git a/plugins/variables/InfoVariableFactory.cpp \
b/plugins/variables/InfoVariableFactory.cpp index 901914b..e1b3217 100644
--- a/plugins/variables/InfoVariableFactory.cpp
+++ b/plugins/variables/InfoVariableFactory.cpp
@@ -56,6 +56,30 @@ InfoVariableFactory::InfoVariableFactory()
var3.properties = props;
addTemplate(var3);
+ KoInlineObjectTemplate var4;
+ var4.id = "file-name";
+ var4.name = i18n("File Name");
+ props = new KoProperties();
+ props->setProperty("vartype", KoInlineObject::DocumentURL);
+ var4.properties = props;
+ addTemplate(var4);
+
+ KoInlineObjectTemplate var5;
+ var5.id = "keywords";
+ var5.name = i18n("Keywords");
+ props = new KoProperties();
+ props->setProperty("vartype", KoInlineObject::Keywords);
+ var5.properties = props;
+ addTemplate(var5);
+
+ KoInlineObjectTemplate var6;
+ var6.id = "comments";
+ var6.name = i18n("Comments");
+ props = new KoProperties();
+ props->setProperty("vartype", KoInlineObject::Comments);
+ var6.properties = props;
+ addTemplate(var6);
+
QStringList elementNames(InfoVariable::tags());
setOdfElementNames(KoXmlNS::text, elementNames);
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic