corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [22/33] incubator-corinthia git commit: ODF: Skeleton functions for get/put/create
Date Fri, 13 Feb 2015 08:21:51 GMT
ODF: Skeleton functions for get/put/create

These match their counterparts in filters/ooxml/src/word/Word.c


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/23837161
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/23837161
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/23837161

Branch: refs/heads/experiment64
Commit: 23837161eaa9cf88b02451095604bb78d7514683
Parents: 2230024
Author: Peter Kelly <peter@uxproductivity.com>
Authored: Sun Jan 11 14:04:43 2015 +0700
Committer: Peter Kelly <peter@uxproductivity.com>
Committed: Sun Jan 11 14:04:43 2015 +0700

----------------------------------------------------------------------
 DocFormats/api/CMakeLists.txt             |  1 +
 DocFormats/api/src/Operations.c           | 10 ++++++++
 DocFormats/filters/odf/CMakeLists.txt     | 10 ++++++--
 DocFormats/filters/odf/src/text/ODFText.c | 33 ++++++++++++++++++++++++++
 DocFormats/filters/odf/src/text/ODFText.h | 26 ++++++++++++++++++++
 5 files changed, 78 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/23837161/DocFormats/api/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/api/CMakeLists.txt b/DocFormats/api/CMakeLists.txt
index e0146ef..148be77 100644
--- a/DocFormats/api/CMakeLists.txt
+++ b/DocFormats/api/CMakeLists.txt
@@ -56,6 +56,7 @@ include_directories(../core/src/names)
 include_directories(../core/src/xml)
 include_directories(../filters/latex/src)
 include_directories(../filters/odf/src)
+include_directories(../filters/odf/src/text)
 include_directories(../filters/ooxml/src/common)
 include_directories(../filters/ooxml/src/word)
 include_directories(../filters/ooxml/src/word/formatting)

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/23837161/DocFormats/api/src/Operations.c
----------------------------------------------------------------------
diff --git a/DocFormats/api/src/Operations.c b/DocFormats/api/src/Operations.c
index 18575cd..3b4500f 100644
--- a/DocFormats/api/src/Operations.c
+++ b/DocFormats/api/src/Operations.c
@@ -18,6 +18,7 @@
 #include "DFString.h"
 #include <DocFormats/DFStorage.h>
 #include "Word.h"
+#include "ODFText.h"
 #include "DFHTML.h"
 #include "DFDOM.h"
 #include "DFXML.h"
@@ -153,6 +154,9 @@ int DFGet(DFConcreteDocument *concrete, DFAbstractDocument *abstract,
DFError **
         case DFFileFormatDocx:
             htmlDoc = WordGet(concrete->storage,abstract->storage,error);
             break;
+        case DFFileFormatOdt:
+            htmlDoc = ODFTextGet(concrete->storage,abstract->storage,error);
+            break;
         default:
             DFErrorFormat(error,"Unsupported file format");
             break;
@@ -178,6 +182,9 @@ int DFPut(DFConcreteDocument *concreteDoc, DFAbstractDocument *abstractDoc,
DFEr
         case DFFileFormatDocx:
             ok = WordPut(concreteDoc->storage,abstractDoc->storage,abstractDoc->htmlDoc,error);
             break;
+        case DFFileFormatOdt:
+            ok = ODFTextPut(concreteDoc->storage,abstractDoc->storage,abstractDoc->htmlDoc,error);
+            break;
         default:
             DFErrorFormat(error,"Unsupported file format");
             break;
@@ -197,6 +204,9 @@ int DFCreate(DFConcreteDocument *concreteDoc, DFAbstractDocument *abstractDoc,
D
         case DFFileFormatDocx:
             ok = WordCreate(concreteDoc->storage,abstractDoc->storage,abstractDoc->htmlDoc,error);
             break;
+        case DFFileFormatOdt:
+            ok = ODFTextCreate(concreteDoc->storage,abstractDoc->storage,abstractDoc->htmlDoc,error);
+            break;
         default:
             DFErrorFormat(error,"Unsupported file format");
             break;

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/23837161/DocFormats/filters/odf/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/filters/odf/CMakeLists.txt b/DocFormats/filters/odf/CMakeLists.txt
index 7787ad6..b38a965 100644
--- a/DocFormats/filters/odf/CMakeLists.txt
+++ b/DocFormats/filters/odf/CMakeLists.txt
@@ -25,6 +25,10 @@ set(GroupSrc
     src/ODFSheet.c
     src/ODFSheet.h)
 
+set(GroupSrcText
+    src/text/ODFText.h
+    src/text/ODFText.c)
+
 set(GroupTests
     tests/ODFTests.c)
 
@@ -62,7 +66,9 @@ include_directories(../../unittest)
 ###
 add_library(odf OBJECT
     ${GroupSrc}
+    ${GroupSrcText}
     ${GroupTests})
-source_group(src   FILES ${GroupSrc})
-source_group(tests FILES ${GroupTests})
+source_group(src         FILES ${GroupSrc})
+source_group(src\\text   FILES ${GroupSrcText})
+source_group(tests       FILES ${GroupTests})
 set_property(TARGET odf PROPERTY FOLDER DocFormats/filters)

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/23837161/DocFormats/filters/odf/src/text/ODFText.c
----------------------------------------------------------------------
diff --git a/DocFormats/filters/odf/src/text/ODFText.c b/DocFormats/filters/odf/src/text/ODFText.c
new file mode 100644
index 0000000..6986499
--- /dev/null
+++ b/DocFormats/filters/odf/src/text/ODFText.c
@@ -0,0 +1,33 @@
+// Copyright 2012-2014 UX Productivity Pty Ltd
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "ODFText.h"
+
+DFDocument *ODFTextGet(DFStorage *concreteStorage, DFStorage *abstractStorage, DFError **error)
+{
+    DFErrorFormat(error,"ODFTextGet: Not yet implemented");
+    return NULL;
+}
+
+int ODFTextPut(DFStorage *concreteStorage, DFStorage *abstractStorage, DFDocument *htmlDoc,
DFError **error)
+{
+    DFErrorFormat(error,"ODFTextPut: Not yet implemented");
+    return 0;
+}
+
+int ODFTextCreate(DFStorage *concreteStorage, DFStorage *abstractStorage, DFDocument *htmlDoc,
DFError **error)
+{
+    DFErrorFormat(error,"ODFTextCreate: Not yet implemented");
+    return 0;
+}

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/23837161/DocFormats/filters/odf/src/text/ODFText.h
----------------------------------------------------------------------
diff --git a/DocFormats/filters/odf/src/text/ODFText.h b/DocFormats/filters/odf/src/text/ODFText.h
new file mode 100644
index 0000000..16f0e5a
--- /dev/null
+++ b/DocFormats/filters/odf/src/text/ODFText.h
@@ -0,0 +1,26 @@
+// Copyright 2012-2014 UX Productivity Pty Ltd
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef DocFormats_ODFText_h
+#define DocFormats_ODFText_h
+
+#include <DocFormats/DFError.h>
+#include <DocFormats/DFStorage.h>
+#include <DocFormats/DFXMLForward.h>
+
+DFDocument *ODFTextGet(DFStorage *concreteStorage, DFStorage *abstractStorage, DFError **error);
+int ODFTextPut(DFStorage *concreteStorage, DFStorage *abstractStorage, DFDocument *htmlDoc,
DFError **error);
+int ODFTextCreate(DFStorage *concreteStorage, DFStorage *abstractStorage, DFDocument *htmlDoc,
DFError **error);
+
+#endif


Mime
View raw message