[Libreoffice-commits] .: 3 commits - shell/prj shell/source
Tor Lillqvist
tml at kemper.freedesktop.org
Mon Aug 22 12:39:28 PDT 2011
shell/prj/build.lst | 8
shell/source/all/ooofilereader/autostyletag.cxx | 102 ------
shell/source/all/ooofilereader/autostyletag.hxx | 75 ----
shell/source/all/ooofilereader/basereader.cxx | 102 ------
shell/source/all/ooofilereader/contentreader.cxx | 240 ---------------
shell/source/all/ooofilereader/dummytag.hxx | 64 ----
shell/source/all/ooofilereader/itag.hxx | 55 ---
shell/source/all/ooofilereader/keywordstag.cxx | 66 ----
shell/source/all/ooofilereader/keywordstag.hxx | 57 ---
shell/source/all/ooofilereader/makefile.mk | 88 -----
shell/source/all/ooofilereader/metainforeader.cxx | 307 --------------------
shell/source/all/ooofilereader/simpletag.cxx | 68 ----
shell/source/all/ooofilereader/simpletag.hxx | 61 ---
shell/source/all/zipfile/makefile.mk | 58 ---
shell/source/all/zipfile/zipexcptn.cxx | 134 --------
shell/source/all/zipfile/zipexcptn.hxx | 79 -----
shell/source/all/zipfile/zipfile.cxx | 247 ----------------
shell/source/tools/lngconvex/makefile.mk | 9
shell/source/win32/ooofilereader/autostyletag.cxx | 102 ++++++
shell/source/win32/ooofilereader/autostyletag.hxx | 75 ++++
shell/source/win32/ooofilereader/basereader.cxx | 102 ++++++
shell/source/win32/ooofilereader/contentreader.cxx | 240 +++++++++++++++
shell/source/win32/ooofilereader/dummytag.hxx | 64 ++++
shell/source/win32/ooofilereader/itag.hxx | 55 +++
shell/source/win32/ooofilereader/keywordstag.cxx | 66 ++++
shell/source/win32/ooofilereader/keywordstag.hxx | 57 +++
shell/source/win32/ooofilereader/makefile.mk | 88 +++++
shell/source/win32/ooofilereader/metainforeader.cxx | 307 ++++++++++++++++++++
shell/source/win32/ooofilereader/simpletag.cxx | 68 ++++
shell/source/win32/ooofilereader/simpletag.hxx | 61 +++
shell/source/win32/zipfile/makefile.mk | 58 +++
shell/source/win32/zipfile/zipexcptn.cxx | 134 ++++++++
shell/source/win32/zipfile/zipexcptn.hxx | 79 +++++
shell/source/win32/zipfile/zipfile.cxx | 247 ++++++++++++++++
34 files changed, 1807 insertions(+), 1816 deletions(-)
New commits:
commit e012efa0b6fbfdd09d81f74e8913f9d40e782ab4
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Mon Aug 22 22:34:04 2011 +0300
chmod -x
diff --git a/shell/source/all/makefile.mk b/shell/source/all/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/backends/desktopbe/makefile.mk b/shell/source/backends/desktopbe/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/backends/gconfbe/makefile.mk b/shell/source/backends/gconfbe/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/backends/kdebe/makefile.mk b/shell/source/backends/kdebe/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/backends/localebe/makefile.mk b/shell/source/backends/localebe/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/backends/wininetbe/makefile.mk b/shell/source/backends/wininetbe/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/cmdmail/makefile.mk b/shell/source/cmdmail/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/tools/lngconvex/makefile.mk b/shell/source/tools/lngconvex/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/tools/regsvrex/makefile.mk b/shell/source/tools/regsvrex/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/unix/exec/makefile.mk b/shell/source/unix/exec/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/unix/misc/makefile.mk b/shell/source/unix/misc/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/unix/sysshell/makefile.mk b/shell/source/unix/sysshell/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/makefile.mk b/shell/source/win32/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/ooofilereader/makefile.mk b/shell/source/win32/ooofilereader/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/shlxthandler/columninfo/makefile.mk b/shell/source/win32/shlxthandler/columninfo/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/shlxthandler/infotips/makefile.mk b/shell/source/win32/shlxthandler/infotips/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/shlxthandler/prophdl/makefile.mk b/shell/source/win32/shlxthandler/prophdl/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/shlxthandler/propsheets/makefile.mk b/shell/source/win32/shlxthandler/propsheets/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/shlxthandler/res/makefile.mk b/shell/source/win32/shlxthandler/res/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/shlxthandler/thumbviewer/makefile.mk b/shell/source/win32/shlxthandler/thumbviewer/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/shlxthandler/util/makefile.mk b/shell/source/win32/shlxthandler/util/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/simplemail/makefile.mk b/shell/source/win32/simplemail/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/workbench/makefile.mk b/shell/source/win32/workbench/makefile.mk
old mode 100755
new mode 100644
diff --git a/shell/source/win32/zipfile/makefile.mk b/shell/source/win32/zipfile/makefile.mk
old mode 100755
new mode 100644
commit 08bf54f9cc532f938084c5e164a96466853269dd
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Mon Aug 22 22:31:21 2011 +0300
No need to mention msvcprt.lib here, wntmsc.mk does that
Besides, hardcoding msvcprt.lib breaks a dbgutil build where we use
msvcprtd.lib.
diff --git a/shell/source/tools/lngconvex/makefile.mk b/shell/source/tools/lngconvex/makefile.mk
index 288f655..f7f2297 100755
--- a/shell/source/tools/lngconvex/makefile.mk
+++ b/shell/source/tools/lngconvex/makefile.mk
@@ -54,19 +54,10 @@ APP1TARGET=$(TARGET)
APP1OBJS=$(OBJ)$/$(TARGET).obj\
$(OBJ)$/cmdline.obj
-# need msvcprt.lib for bad_cast exception
-# symbols if we compiler with exceptions
-# only valid for a tool like this
-
APP1STDLIBS= $(SALLIB)\
$(TOOLSLIB)\
$(I18NISOLANGLIB)
-.IF "$(COM)"!="GCC"
-APP1STDLIBS+= msvcprt.lib
-#$(TOOLSLIBST)
-.ENDIF
-
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
commit 2fbd5d475049576fca51ecb10941dd56ca87133a
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Mon Aug 22 22:03:26 2011 +0300
Move Win32-only code under source/win32 for clarity
diff --git a/shell/prj/build.lst b/shell/prj/build.lst
index 4ae5970..6dc5270 100644
--- a/shell/prj/build.lst
+++ b/shell/prj/build.lst
@@ -9,8 +9,8 @@ sl shell\source\all nmake - all sl_all sl_inc
sl shell\source\unix\sysshell nmake - u sl_unix_sysshell sl_all sl_inc NULL
sl shell\source\tools\lngconvex nmake - all sl_win32_lngconv sl_inc NULL
sl shell\source\tools\regsvrex nmake - w sl_win32_regsvrex sl_inc NULL
-sl shell\source\all\zipfile nmake - w sl_all_zipfile sl_inc NULL
-sl shell\source\all\ooofilereader nmake - w sl_all_ooofilereader sl_all_zipfile.w sl_all sl_inc NULL
+sl shell\source\win32\zipfile nmake - w sl_win32_zipfile sl_inc NULL
+sl shell\source\win32\ooofilereader nmake - w sl_win32_ooofilereader sl_win32_zipfile.w sl_all sl_inc NULL
sl shell\source\win32\shlxthandler\res nmake - w sl_win32_shlxthandler_res sl_win32_lngconv.w sl_inc NULL
sl shell\source\win32\shlxthandler\util nmake - w sl_win32_shlxthandler_util sl_inc NULL
sl shell\source\win32\shlxthandler\propsheets nmake - w sl_win32_shlxthandler_propsheets sl_inc NULL
@@ -18,7 +18,7 @@ sl shell\source\win32\shlxthandler\infotips nmake - w sl_win32_shlx
sl shell\source\win32\shlxthandler\columninfo nmake - w sl_win32_shlxthandler_columninfo sl_inc NULL
sl shell\source\win32\shlxthandler\thumbviewer nmake - w sl_win32_shlxthandler_thumbviewer sl_inc NULL
sl shell\source\win32\shlxthandler\prophdl nmake - w sl_win32_shlxthandler_prophdl sl_win32_shlxthandler_ooofilt.w sl_inc NULL
-sl shell\source\win32\shlxthandler nmake - w sl_win32_shlxthandler sl_win32_lngconv.w sl_win32_shlxthandler_res.w sl_win32_shlxthandler_util.w sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_propsheets.w sl_win32_shlxthandler_infotips.w sl_win32_shlxthandler_columninfo.w sl_win32_shlxthandler_thumbviewer.w sl_win32_shlxthandler_prophdl.w sl_inc sl_win32_shlxthandler_ooofilt.w NULL
+sl shell\source\win32\shlxthandler nmake - w sl_win32_shlxthandler sl_win32_lngconv.w sl_win32_shlxthandler_res.w sl_win32_shlxthandler_util.w sl_win32_zipfile.w sl_win32_ooofilereader.w sl_win32_shlxthandler_propsheets.w sl_win32_shlxthandler_infotips.w sl_win32_shlxthandler_columninfo.w sl_win32_shlxthandler_thumbviewer.w sl_win32_shlxthandler_prophdl.w sl_inc sl_win32_shlxthandler_ooofilt.w NULL
sl shell\source\backends\localebe nmake - all sl_backends_localebe sl_inc NULL
sl shell\source\backends\wininetbe nmake - w sl_backends_wininetbe sl_inc NULL
sl shell\source\backends\macbe nmake - u sl_backends_macbe sl_inc NULL
@@ -26,4 +26,4 @@ sl shell\source\backends\gconfbe nmake - u sl_backends_g
sl shell\source\backends\kdebe nmake - u sl_backends_kdebe sl_inc NULL
sl shell\source\backends\kde4be nmake - u sl_backends_kde4be sl_inc NULL
sl shell\source\backends\desktopbe nmake - u sl_backends_desktopbe sl_inc NULL
-sl shell\source\win32\shlxthandler\ooofilt nmake - w sl_win32_shlxthandler_ooofilt sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL
+sl shell\source\win32\shlxthandler\ooofilt nmake - w sl_win32_shlxthandler_ooofilt sl_win32_zipfile.w sl_win32_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL
diff --git a/shell/source/all/ooofilereader/autostyletag.cxx b/shell/source/all/ooofilereader/autostyletag.cxx
deleted file mode 100644
index 3cf81a7..0000000
--- a/shell/source/all/ooofilereader/autostyletag.cxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "autostyletag.hxx"
-
-/*********************** CAutoStyleTag ***********************/
-
-CAutoStyleTag::CAutoStyleTag( const XmlTagAttributes_t& attributes ):
- m_CurrentStyleLocalePair( EMPTY_STYLELOCALE_PAIR )
-{
- addAttributes( attributes);
-};
-
-void CAutoStyleTag::startTag()
-{
-}
-
-void CAutoStyleTag::endTag()
-{
-}
-
-void CAutoStyleTag::addCharacters(const std::wstring&)
-{
-}
-
-void CAutoStyleTag::addAttributes(const XmlTagAttributes_t& attributes)
-{
- if ( EMPTY_STYLELOCALE_PAIR == m_CurrentStyleLocalePair )
- {
- // the style-locale pair should be empty when entering STYLE_STYLE
- // tag, and otherwise should be STYLE_PROPERTIES.
-
- XmlTagAttributes_t::const_iterator iter = attributes.find(CONTENT_STYLE_STYLE_NAME);
-
- if ( iter != attributes.end())
- setStyle( iter->second );
- }
- else
- {
- // tag STYLE_PROPERTIES entered.
-
- XmlTagAttributes_t::const_iterator iter_lan = attributes.find(CONTENT_STYLE_PROPERTIES_LANGUAGE);
- XmlTagAttributes_t::const_iterator iter_con = attributes.find(CONTENT_STYLE_PROPERTIES_COUNTRY);
- XmlTagAttributes_t::const_iterator iter_lan_asain = attributes.find(CONTENT_STYLE_PROPERTIES_LANGUAGEASIAN);
- XmlTagAttributes_t::const_iterator iter_con_asain = attributes.find(CONTENT_STYLE_PROPERTIES_COUNTRYASIAN);
-
- // if style:properties | fo:language or style:language-asian is exist,
- // set the locale field, otherwise clear the style-locale pair;
- if ( ( iter_lan!= attributes.end() ) && ( iter_con != attributes.end() ) )
- setLocale( ::std::make_pair( iter_lan->second,iter_con->second ) );
- else if ( ( iter_lan_asain!= attributes.end() ) && ( iter_con_asain != attributes.end() ) )
- setLocale( ::std::make_pair( iter_lan_asain->second,iter_con_asain->second ) );
- else
- clearStyleLocalePair();
- }
-
-}
-
-void CAutoStyleTag::setStyle( ::std::wstring const & Style )
-{
- m_CurrentStyleLocalePair.first = Style;
-}
-
-void CAutoStyleTag::setLocale( LocaleSet_t Locale )
-{
- m_CurrentStyleLocalePair.second = Locale;
-}
-
-void CAutoStyleTag::clearStyleLocalePair( )
-{
- m_CurrentStyleLocalePair = EMPTY_STYLELOCALE_PAIR;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/ooofilereader/autostyletag.hxx b/shell/source/all/ooofilereader/autostyletag.hxx
deleted file mode 100644
index c392b53..0000000
--- a/shell/source/all/ooofilereader/autostyletag.hxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef AUTOSTYLETAG_HXX_INCLUDED
-#define AUTOSTYLETAG_HXX_INCLUDED
-
-#include "itag.hxx"
-
-/*************************** CAutoStyleTag tag readers ***************************/
-
-/** Implements the ITag interface for
- building a Style-Locale list
-
- Usage sample:
-
- LocaleSet_t locale = meta_info_accessor.getDefaultLocale();
- CContentReader content( m_szFileName, locale );
- CStyleMap map = content.getStyleMap();
-*/
-class CAutoStyleTag : public ITag
-{
- public:
- CAutoStyleTag():m_CurrentStyleLocalePair( EMPTY_STYLELOCALE_PAIR ){};
- CAutoStyleTag( const XmlTagAttributes_t& attributes );
-
- virtual void startTag();
- virtual void endTag();
- virtual void addCharacters(const std::wstring& characters);
- virtual void addAttributes(const XmlTagAttributes_t& attributes);
- virtual std::wstring getTagContent(){ return EMPTY_STRING; };
- virtual ::std::wstring const getTagAttribute( ::std::wstring const & /*attrname*/ ){ return ::std::wstring() ; };
-
- void setStyle( ::std::wstring const & Style );
- void setLocale( LocaleSet_t Locale );
- void clearStyleLocalePair( void );
- inline StyleLocalePair_t getStyleLocalePair() const{ return m_CurrentStyleLocalePair; };
- inline bool isFull() const
- {
- return (( m_CurrentStyleLocalePair.first != EMPTY_STRING )&&
- ( m_CurrentStyleLocalePair.second != EMPTY_LOCALE));
- };
-
- private:
- StyleLocalePair_t m_CurrentStyleLocalePair;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/ooofilereader/basereader.cxx b/shell/source/all/ooofilereader/basereader.cxx
deleted file mode 100644
index 1b8c139..0000000
--- a/shell/source/all/ooofilereader/basereader.cxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include <osl/diagnose.h>
-
-#include "internal/basereader.hxx"
-
-#include "internal/xml_parser.hxx"
-
-#include "assert.h"
-#include <memory>
-
-/** constructor of CBaseReader.
-*/
-CBaseReader::CBaseReader(const std::string& DocumentName):
-m_ZipFile( DocumentName )
-{
-}
-
-//------------------------------
-
-CBaseReader::CBaseReader(void * sw, zlib_filefunc_def* fa):
-m_ZipFile( sw , fa )
-{
-}
-
-//------------------------------
-
-CBaseReader::~CBaseReader()
-{
-}
-
-//------------------------------
-
-void CBaseReader::start_document()
-{
-}
-
-//------------------------------
-
-void CBaseReader::end_document()
-{
-}
-
-/** Read interested tag content into respective structure then start parsing process.
- @param ContentName
- the xml file name in the zipped document which we interest.
-*/
-void CBaseReader::Initialize( const std::string& ContentName)
-{
- try
- {
- if (m_ZipContent.empty())
- m_ZipFile.GetUncompressedContent( ContentName, m_ZipContent );
-
- xml_parser parser;
- parser.set_document_handler(this); // pass current reader as reader to the sax parser
- parser.parse(&m_ZipContent[0], m_ZipContent.size());
- }
- catch(std::exception&
- #if OSL_DEBUG_LEVEL > 0
- ex
- #endif
- )
- {
- OSL_ENSURE( false, ex.what() );
- }
- catch(...)
- {
- OSL_ENSURE(false, "Unknown error");
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/ooofilereader/contentreader.cxx b/shell/source/all/ooofilereader/contentreader.cxx
deleted file mode 100644
index e021383..0000000
--- a/shell/source/all/ooofilereader/contentreader.cxx
+++ /dev/null
@@ -1,240 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include <osl/diagnose.h>
-
-#include "internal/contentreader.hxx"
-#include "dummytag.hxx"
-#include "simpletag.hxx"
-#include "autostyletag.hxx"
-
-#include "assert.h"
-
-/** constructor.
-*/
-CContentReader::CContentReader( const std::string& DocumentName, LocaleSet_t const & DocumentLocale ):
-CBaseReader( DocumentName )
-{
- try
- {
- m_DefaultLocale = DocumentLocale;
- Initialize( DOC_CONTENT_NAME );
- }
- catch(xml_parser_exception&
- #if OSL_DEBUG_LEVEL > 0
- ex
- #endif
- )
- {
- OSL_ENSURE(false, ex.what());
- }
- catch(...)
- {
- OSL_ENSURE(false, "Unknown error");
- }
-}
-
-CContentReader::CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa ) :
-CBaseReader( stream, fa )
-{
-try
- {
- m_DefaultLocale = DocumentLocale;
- Initialize( DOC_CONTENT_NAME );
- }
- catch(xml_parser_exception&
- #if OSL_DEBUG_LEVEL > 0
- ex
- #endif
- )
- {
- OSL_ENSURE(false, ex.what());
- }
- catch(...)
- {
- OSL_ENSURE(false, "Unknown error");
- }
-}
-
-
-/** destructor.
-*/
-
-CContentReader::~CContentReader( void )
-{
-}
-
-/*********************** helper functions ***********************/
-
-/** choose an appropriate tag reader
-*/
-
-ITag* CContentReader::chooseTagReader( const std::wstring& tag_name, const XmlTagAttributes_t& XmlAttributes )
-{
- if (( tag_name == CONTENT_TEXT_A )||( tag_name == CONTENT_TEXT_P )||
- ( tag_name == CONTENT_TEXT_SPAN ) ||( tag_name == CONTENT_TEXT_H )||
- ( tag_name == CONTENT_TEXT_SEQUENCE ) ||( tag_name == CONTENT_TEXT_BOOKMARK_REF )||
- ( tag_name == CONTENT_TEXT_INDEX_TITLE_TEMPLATE ) )
- return new CSimpleTag(XmlAttributes);
- else if ( tag_name == CONTENT_STYLE_STYLE )
- {
- // if style:style | style:name is exist,, fill the style field, otherwise do nothing;
- if ( XmlAttributes.find(CONTENT_STYLE_STYLE_NAME) != XmlAttributes.end())
- return new CAutoStyleTag(XmlAttributes);
- else
- return new CDummyTag();
- }
- else if ( ( tag_name == CONTENT_STYLE_PROPERTIES ) || ( tag_name == CONTENT_TEXT_STYLE_PROPERTIES ) )
- {
- assert( !m_TagBuilderStack.empty() );
-
- //here we presume that if CONTENT_STYLE_PROPERTIES tag is present, it just follow CONTENT_STYLE_STYLE;
- ITag* pTagBuilder = m_TagBuilderStack.top();
- pTagBuilder->addAttributes( XmlAttributes );
-
- return new CDummyTag();
- }
- else
- return new CDummyTag();
-}
-
-/** get style of the current content.
-*/
-::std::wstring CContentReader::getCurrentContentStyle( void )
-{
- assert( !m_TagBuilderStack.empty() );
- ITag* pTagBuilder = m_TagBuilderStack.top();
-
- return ( pTagBuilder->getTagAttribute(CONTENT_TEXT_STYLENAME) );
-}
-
-/** add chunk into Chunk Buffer.
-*/
-void CContentReader::addChunk( LocaleSet_t const & Locale, Content_t const & Content )
-{
- if ( Content == EMPTY_STRING )
- return;
-
- if ( ( ( m_ChunkBuffer.empty() ) || ( m_ChunkBuffer.back().first != Locale ) ) &&
- ( ( Content != SPACE ) && ( Content != LF ) ) )
- {
- // if met a new locale, add a blank new chunk;
- Chunk_t Chunk;
- Chunk.first = Locale;
- Chunk.second = EMPTY_STRING;
- m_ChunkBuffer.push_back( Chunk );
- }
-
- if ( !m_ChunkBuffer.empty() )
- m_ChunkBuffer.back().second += Content;
-}
-
-/** get a style's locale field.
-*/
-
-LocaleSet_t const & CContentReader::getLocale( const StyleName_t Style )
-{
- if ( m_StyleMap.empty() )
- return m_DefaultLocale;
-
- StyleLocaleMap_t :: const_iterator style_Iter;
-
- if ( ( style_Iter = m_StyleMap.find( Style ) ) == m_StyleMap.end( ) )
- return m_DefaultLocale;
- else
- return style_Iter->second;
-
-}
-
-/*********************** event handler functions ***********************/
-
-//------------------------------
-// start_element occurs when a tag is start
-//------------------------------
-
-void CContentReader::start_element(
- const std::wstring& /*raw_name*/,
- const std::wstring& local_name,
- const XmlTagAttributes_t& attributes)
-{
- //get appropriate Xml Tag Builder using MetaInfoBuilderFactory;
- ITag* pTagBuilder = chooseTagReader( local_name,attributes );
- assert( pTagBuilder != NULL );
- pTagBuilder->startTag( );
- m_TagBuilderStack.push( pTagBuilder );
-
-}
-
-//------------------------------
-// end_element occurs when a tag is closed
-//------------------------------
-
-void CContentReader::end_element(const std::wstring& /*raw_name*/, const std::wstring& local_name)
-{
- assert( !m_TagBuilderStack.empty() );
- ITag* pTagBuilder = m_TagBuilderStack.top();
-
- if ( local_name == CONTENT_STYLE_STYLE )
- {
- StyleLocalePair_t StyleLocalePair = static_cast<CAutoStyleTag * >( pTagBuilder)->getStyleLocalePair();
- if ( ( static_cast<CAutoStyleTag * >( pTagBuilder)->isFull() ) && ( StyleLocalePair.second != m_DefaultLocale ) )
- m_StyleMap.insert( StyleLocalePair );
- }
- if (( local_name == CONTENT_TEXT_A )||( local_name == CONTENT_TEXT_SPAN ) ||
- ( local_name == CONTENT_TEXT_SEQUENCE )||( local_name == CONTENT_TEXT_BOOKMARK_REF ))
- addChunk( getLocale( getCurrentContentStyle() ), ::std::wstring( SPACE ) );
- if ((( local_name == CONTENT_TEXT_P )||( local_name == CONTENT_TEXT_H ) ||
- ( local_name == CONTENT_TEXT_INDEX_TITLE_TEMPLATE ) )&&
- ( EMPTY_STRING != pTagBuilder->getTagContent( ) ) )
- addChunk( getLocale( getCurrentContentStyle() ), ::std::wstring( LF ) );
-
- m_TagBuilderStack.pop();
- pTagBuilder->endTag();
- delete pTagBuilder;
-
-}
-
-//------------------------------
-// characters occurs when receiving characters
-//------------------------------
-
-void CContentReader::characters( const std::wstring& character )
-{
- if ( character.length() > 0 && !HasOnlySpaces( character ) )
- {
- addChunk( getLocale( getCurrentContentStyle() ), ::std::wstring( character ) );
-
- ITag* pTagBuilder = m_TagBuilderStack.top();
- pTagBuilder->addCharacters( character );
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/ooofilereader/dummytag.hxx b/shell/source/all/ooofilereader/dummytag.hxx
deleted file mode 100644
index b7007f5..0000000
--- a/shell/source/all/ooofilereader/dummytag.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef DUMMYTAG_HXX_INCLUDED
-#define DUMMYTAG_HXX_INCLUDED
-
-#include "itag.hxx"
-
-/*************************** dummy tag readers ***************************/
-
-/** Implements the ITag interface but does
- nothing (Null object pattern), may be used for
- tags we are not interessted in to avoid if-else
- branches.
-*/
-class CDummyTag : public ITag
-{
- public:
- virtual void startTag(){};
-
- virtual void endTag(){};
-
- virtual void addCharacters(const std::wstring& /*characters*/){};
-
- virtual void addAttributes(const XmlTagAttributes_t& /*attributes*/){};
-
- virtual std::wstring getTagContent( void )
- {
- return EMPTY_STRING;
- };
-
- virtual ::std::wstring const getTagAttribute( ::std::wstring const & /*attrname*/ ){ return ::std::wstring(EMPTY_STRING); };
-};
-
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/ooofilereader/itag.hxx b/shell/source/all/ooofilereader/itag.hxx
deleted file mode 100644
index c4a7eea..0000000
--- a/shell/source/all/ooofilereader/itag.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef ITAG_HXX_INCLUDED
-#define ITAG_HXX_INCLUDED
-
-#include "internal/config.hxx"
-#include "internal/types.hxx"
-
-/*************************** interface of tag readers ***************************/
-
-/** Interface for a xml tag character builder
-*/
-class ITag
-{
- public:
- virtual ~ITag() {};
-
- virtual void startTag() = 0;
- virtual void endTag() = 0;
- virtual void addCharacters(const std::wstring& characters) = 0;
- virtual void addAttributes(const XmlTagAttributes_t& attributes) = 0;
- virtual ::std::wstring getTagContent( void ) = 0;
- virtual ::std::wstring const getTagAttribute( ::std::wstring const & attrname ) = 0;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/ooofilereader/keywordstag.cxx b/shell/source/all/ooofilereader/keywordstag.cxx
deleted file mode 100644
index 695bfe8..0000000
--- a/shell/source/all/ooofilereader/keywordstag.cxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "keywordstag.hxx"
-
-/*********************** CKeywordsTag ***********************/
-
-void CKeywordsTag::startTag()
-{
- m_sCurrentKeyword.clear();
-}
-
-void CKeywordsTag::endTag()
-{
- m_slKeywords.push_back(m_sCurrentKeyword);
-}
-
-void CKeywordsTag::addCharacters(const std::wstring& characters)
-{
- m_sCurrentKeyword += characters;
-}
-
-void CKeywordsTag::addAttributes(const XmlTagAttributes_t& /*attributes*/)
-{
- // there are no attributes for keywords
-}
-
-std::wstring CKeywordsTag::getTagContent( )
-{
- StringList_t::const_iterator keywords_Iter= m_slKeywords.begin( );
- StringList_t::const_iterator keywords_Iter_end = m_slKeywords.end( );
-
- std::wstring ret_KeyWord_String = ( keywords_Iter != keywords_Iter_end) ? *keywords_Iter++ : L"";
- for ( ; keywords_Iter != keywords_Iter_end; ++keywords_Iter)
- ret_KeyWord_String += L"," + *keywords_Iter;
- return ret_KeyWord_String;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/ooofilereader/keywordstag.hxx b/shell/source/all/ooofilereader/keywordstag.hxx
deleted file mode 100644
index 9a761ac..0000000
--- a/shell/source/all/ooofilereader/keywordstag.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef KEYWORDSTAG_HXX_INCLUDED
-#define KEYWORDSTAG_HXX_INCLUDED
-
-#include "itag.hxx"
-
-/*************************** metainfo tag readers ***************************/
-
-/** Implements the ITag interface for
- building a keyword list
-*/
-class CKeywordsTag : public ITag
-{
- public:
- virtual void startTag();
- virtual void endTag();
- virtual void addCharacters(const std::wstring& characters);
- virtual void addAttributes(const XmlTagAttributes_t& attributes);
- virtual std::wstring getTagContent();
- virtual ::std::wstring const getTagAttribute( ::std::wstring const & /*attrname*/ ){ return ::std::wstring(); };
-
- private:
- StringList_t m_slKeywords;
- std::wstring m_sCurrentKeyword;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/ooofilereader/makefile.mk b/shell/source/all/ooofilereader/makefile.mk
deleted file mode 100755
index 90f0429..0000000
--- a/shell/source/all/ooofilereader/makefile.mk
+++ /dev/null
@@ -1,88 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJNAME=shell
-TARGET=ooofilereader
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501
-.IF "$(COM)" == "MSC"
-CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820
-.ENDIF
-CDEFS+=-D_WIN32_IE=0x501
-CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501
-.IF "$(COM)" == "MSC"
-CFLAGS_X64+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820
-.ENDIF
-CDEFS_X64+=-D_WIN32_IE=0x501
-
-# --- Files --------------------------------------------------------
-
-
-SLOFILES=$(SLO)$/basereader.obj\
- $(SLO)$/metainforeader.obj\
- $(SLO)$/contentreader.obj\
- $(SLO)$/simpletag.obj\
- $(SLO)$/keywordstag.obj\
- $(SLO)$/autostyletag.obj
-
-LIB1TARGET=$(SLB)$/$(TARGET).lib
-LIB1OBJFILES=$(SLOFILES)
-LIB1FILES=$(SLB)$/zipfile.lib\
- $(SLB)$/xmlparser.lib
-
-.IF "$(BUILD_X64)"!=""
-SLOFILES_X64=$(SLO_X64)$/basereader.obj\
- $(SLO_X64)$/metainforeader.obj\
- $(SLO_X64)$/contentreader.obj\
- $(SLO_X64)$/simpletag.obj\
- $(SLO_X64)$/keywordstag.obj\
- $(SLO_X64)$/autostyletag.obj
-
-LIB1TARGET_X64=$(SLB_X64)$/$(TARGET).lib
-LIB1OBJFILES_X64=$(SLOFILES_X64)
-LIB1FILES_X64=$(SLB_X64)$/zipfile.lib\
- $(SLB_X64)$/xmlparser.lib
-.ENDIF # "$(BUILD_X64)"!=""
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : set_wntx64.mk
-.INCLUDE : target.mk
-.IF "$(OS)" == "WNT"
-INCLUDE!:=$(subst,/stl, $(INCLUDE))
-
-.ENDIF
-.INCLUDE : tg_wntx64.mk
-
diff --git a/shell/source/all/ooofilereader/metainforeader.cxx b/shell/source/all/ooofilereader/metainforeader.cxx
deleted file mode 100644
index 71be055..0000000
--- a/shell/source/all/ooofilereader/metainforeader.cxx
+++ /dev/null
@@ -1,307 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include <osl/diagnose.h>
-
-#include "internal/metainforeader.hxx"
-#include "dummytag.hxx"
-#include "simpletag.hxx"
-#include "keywordstag.hxx"
-
-#include "assert.h"
-
-/** constructor.
-*/
-CMetaInfoReader::CMetaInfoReader( const std::string& DocumentName ):
-CBaseReader( DocumentName )
-{
- try
- {
- m_pKeywords_Builder = new CKeywordsTag( );
- m_pSimple_Builder = new CSimpleTag( );
- m_pDummy_Builder = new CDummyTag( );
-
- //retrieve all infomation that is useful
- m_AllMetaInfo[META_INFO_AUTHOR] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_TITLE] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_SUBJECT] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_KEYWORDS] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_DESCRIPTION] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_DOCUMENT_STATISTIC] = EMPTY_XML_TAG;
-
- m_AllMetaInfo[META_INFO_GENERATOR] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_CREATION] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_CREATOR] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_MODIFIED] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_LANGUAGE] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_DOCUMENT_NUMBER] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_EDITING_TIME] = EMPTY_XML_TAG;
-
- Initialize( META_CONTENT_NAME );
- }
- catch(xml_parser_exception&
- #if OSL_DEBUG_LEVEL > 0
- ex
- #endif
- )
- {
- OSL_ENSURE(false, ex.what());
- }
- catch(...)
- {
- OSL_ENSURE(false, "Unknown error");
- }
-}
-
-CMetaInfoReader::CMetaInfoReader( void* stream, zlib_filefunc_def* fa) :
-CBaseReader( stream, fa)
-{
-try
- {
- m_pKeywords_Builder = new CKeywordsTag( );
- m_pSimple_Builder = new CSimpleTag( );
- m_pDummy_Builder = new CDummyTag( );
-
- //retrieve all infomation that is useful
- m_AllMetaInfo[META_INFO_AUTHOR] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_TITLE] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_SUBJECT] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_KEYWORDS] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_DESCRIPTION] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_DOCUMENT_STATISTIC] = EMPTY_XML_TAG;
-
- m_AllMetaInfo[META_INFO_GENERATOR] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_CREATION] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_CREATOR] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_MODIFIED] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_LANGUAGE] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_DOCUMENT_NUMBER] = EMPTY_XML_TAG;
- m_AllMetaInfo[META_INFO_EDITING_TIME] = EMPTY_XML_TAG;
-
- Initialize( META_CONTENT_NAME );
- }
- catch(xml_parser_exception&
- #if OSL_DEBUG_LEVEL > 0
- ex
- #endif
- )
- {
- OSL_ENSURE(false, ex.what());
- }
- catch(...)
- {
- OSL_ENSURE(false, "Unknown error");
- }
-
-}
-
-/** destructor.
-*/
-
-CMetaInfoReader::~CMetaInfoReader( void )
-{
- delete m_pKeywords_Builder;
- delete m_pSimple_Builder;
- delete m_pDummy_Builder;
-}
-
-
-/*********************** export functions ***********************/
-
-/** check if the Tag is in the target meta.xml file.
-
- @param TagName
- the name of the tag that will be retrive.
-*/
-bool CMetaInfoReader::hasTag( std::wstring TagName ) const
-{
- return ( m_AllMetaInfo.find(TagName) != m_AllMetaInfo.end());
-}
-
-/** Get a specific tag content, compound tags will be returned as comma separated list.
-
- @param TagName
- the name of the tag that will be retrive.
-*/
-std::wstring CMetaInfoReader::getTagData( const std::wstring& TagName)
-{
- if( hasTag( TagName ) )
- return m_AllMetaInfo[TagName].first;
- else
- return EMPTY_STRING;
-}
-
-/** check if the a tag has the specific attribute.
-
- @param TagName
- the name of the tag.
- @param AttributeName
- the name of the attribute.
-*/
-bool CMetaInfoReader::hasTagAttribute( const std::wstring TagName, std::wstring AttributeName)
-{
- return ( m_AllMetaInfo[TagName].second.find( AttributeName) != m_AllMetaInfo[TagName].second.end() );
-}
-
-/** Get a specific attribute content.
-
- @param TagName
- the name of the tag.
- @param AttributeName
- the name of the attribute.
-*/
-std::wstring CMetaInfoReader::getTagAttribute( const std::wstring TagName, std::wstring AttributeName)
-{
- if ( hasTagAttribute( TagName, AttributeName ) )
- return m_AllMetaInfo[ TagName ].second[AttributeName];
- else
- return EMPTY_STRING;
-}
-
-/** helper function for getDefaultLocale().
-*/
-const LocaleSet_t EN_US_LOCALE( ::std::make_pair( ::std::wstring( L"en" ), ::std::wstring( L"US" )));
-
-bool isValidLocale ( ::std::wstring Locale )
-{
- return ( Locale.length() == 5 );
-}
-
-/** Get the default language of the whole document, if no such field, en-US is returned.
-*/
-LocaleSet_t CMetaInfoReader::getDefaultLocale()
-{
- if (hasTag(META_INFO_LANGUAGE))
- {
- ::std::wstring locale = m_AllMetaInfo[META_INFO_LANGUAGE].first;
- return isValidLocale(locale) ? ::std::make_pair(locale.substr( 0,2), locale.substr( 3,2)) : EN_US_LOCALE;
- }
- else
- return EN_US_LOCALE;
-}
-
-/*********************** tag related functions ***********************/
-
-/** choose an appropriate tag reader
-*/
-
-ITag* CMetaInfoReader::chooseTagReader( const std::wstring& tag_name, const XmlTagAttributes_t& XmlAttributes )
-{
- if ( tag_name == META_INFO_KEYWORD )
- {
- m_AllMetaInfo[META_INFO_KEYWORDS].second = XmlAttributes;
- return m_pKeywords_Builder;
- }
- if (( tag_name == META_INFO_TITLE )||( tag_name == META_INFO_AUTHOR )||( tag_name == META_INFO_SUBJECT )||( tag_name == META_INFO_DESCRIPTION )||
- ( tag_name == META_INFO_DOCUMENT_STATISTIC )||( tag_name == META_INFO_GENERATOR )||( tag_name == META_INFO_CREATION )||( tag_name == META_INFO_CREATOR )||
- ( tag_name == META_INFO_MODIFIED )||( tag_name == META_INFO_LANGUAGE )||( tag_name == META_INFO_DOCUMENT_NUMBER )||( tag_name == META_INFO_EDITING_TIME ) )
- {
- m_AllMetaInfo[tag_name].second = XmlAttributes;
- return m_pSimple_Builder;
- }
- else
- return m_pDummy_Builder;
-
-}
-
-//------------------------------
-// save the received content into structure.
-//------------------------------
-void CMetaInfoReader::saveTagContent( const std::wstring& tag_name )
-{
- ITag* pTagBuilder;
- if ( tag_name == META_INFO_KEYWORDS )
- pTagBuilder = m_pKeywords_Builder;
- else if ( tag_name == META_INFO_KEYWORD )
- {
- // added for support for OASIS xml file format.
- m_AllMetaInfo[META_INFO_KEYWORDS].first =m_pKeywords_Builder->getTagContent( );
- return;
- }
- else if (( tag_name == META_INFO_TITLE )||( tag_name == META_INFO_AUTHOR )||( tag_name == META_INFO_SUBJECT )||( tag_name == META_INFO_DESCRIPTION )||
- ( tag_name == META_INFO_DOCUMENT_STATISTIC )||( tag_name == META_INFO_GENERATOR )||( tag_name == META_INFO_CREATION )||( tag_name == META_INFO_CREATOR )||
- ( tag_name == META_INFO_MODIFIED )||( tag_name == META_INFO_LANGUAGE )||( tag_name == META_INFO_DOCUMENT_NUMBER )||( tag_name == META_INFO_EDITING_TIME ) )
- pTagBuilder = m_pSimple_Builder;
- else
- pTagBuilder = m_pDummy_Builder;
-
- m_AllMetaInfo[tag_name].first =pTagBuilder->getTagContent( );
-}
-
-
-/*********************** event handler functions ***********************/
-
-//------------------------------
-// start_element occurs when a tag is start
-//------------------------------
-
-void CMetaInfoReader::start_element(
- const std::wstring& /*raw_name*/,
- const std::wstring& local_name,
- const XmlTagAttributes_t& attributes)
-{
- //get appropriate Xml Tag Builder using MetaInfoBuilderFactory;
- ITag* pTagBuilder = chooseTagReader( local_name,attributes );
- assert( pTagBuilder!= NULL );
- pTagBuilder->startTag( );
- m_TagBuilderStack.push( pTagBuilder );
-
-}
-
-//------------------------------
-// end_element occurs when a tag is closed
-//------------------------------
-
-void CMetaInfoReader::end_element(const std::wstring& /*raw_name*/, const std::wstring& local_name)
-{
- assert( !m_TagBuilderStack.empty() );
- ITag* pTagBuilder = m_TagBuilderStack.top();
- m_TagBuilderStack.pop();
- pTagBuilder->endTag();
-
- saveTagContent( local_name );
-
-}
-
-//------------------------------
-// characters occurs when receiving characters
-//------------------------------
-
-void CMetaInfoReader::characters( const std::wstring& character )
-{
- if ( character.length() > 0 && !HasOnlySpaces( character ) )
- {
- ITag* pTagBuilder = m_TagBuilderStack.top();
- pTagBuilder->addCharacters( character );
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/ooofilereader/simpletag.cxx b/shell/source/all/ooofilereader/simpletag.cxx
deleted file mode 100644
index fa9f287..0000000
--- a/shell/source/all/ooofilereader/simpletag.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "simpletag.hxx"
-
-/*********************** CSimpleTag ***********************/
-void CSimpleTag::startTag()
-{
- m_SimpleContent = L"";
-}
-
-
-void CSimpleTag::endTag()
-{
-
-}
-
-void CSimpleTag::addCharacters(const std::wstring& characters)
-{
- m_SimpleContent += characters;
-}
-
-void CSimpleTag::addAttributes(const XmlTagAttributes_t& attributes )
-{
- m_SimpleAttributes = attributes;
-}
-
-std::wstring CSimpleTag::getTagContent( )
-{
- return m_SimpleContent;
-}
-
-::std::wstring const CSimpleTag::getTagAttribute( ::std::wstring const & attrname )
-{
- if ( m_SimpleAttributes.find(attrname) != m_SimpleAttributes.end())
- return m_SimpleAttributes[attrname];
- else
- return ( ::std::wstring( EMPTY_STRING ) );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/ooofilereader/simpletag.hxx b/shell/source/all/ooofilereader/simpletag.hxx
deleted file mode 100644
index fb4b5d8..0000000
--- a/shell/source/all/ooofilereader/simpletag.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef SIMPLETAG_HXX_INCLUDED
-#define SIMPLETAG_HXX_INCLUDED
-
-#include "itag.hxx"
-
-/*************************** simple tag readers ***************************/
-
-/** Implements the ITag interface for
- building a general info that is not a compound tag.
-*/
-class CSimpleTag : public ITag
-{
- public:
- CSimpleTag(){};
- CSimpleTag( const XmlTagAttributes_t& attributes ):m_SimpleAttributes(attributes){};
-
- virtual void startTag();
- virtual void endTag();
- virtual void addCharacters(const std::wstring& characters);
- virtual void addAttributes(const XmlTagAttributes_t& attributes);
- virtual std::wstring getTagContent();
-
- virtual ::std::wstring const getTagAttribute( ::std::wstring const & attrname );
-
- private:
- std::wstring m_SimpleContent;
- XmlTagAttributes_t m_SimpleAttributes;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/zipfile/makefile.mk b/shell/source/all/zipfile/makefile.mk
deleted file mode 100755
index 93fdf66..0000000
--- a/shell/source/all/zipfile/makefile.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJNAME=shell
-TARGET=zipfile
-ENABLE_EXCEPTIONS=TRUE
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-
-SLOFILES=$(SLO)$/zipfile.obj\
- $(SLO)$/zipexcptn.obj
-
-SLOFILES_X64=$(SLO_X64)$/zipfile.obj\
- $(SLO_X64)$/zipexcptn.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : set_wntx64.mk
-.INCLUDE : target.mk
-.IF "$(OS)" == "WNT"
-INCLUDE!:=$(subst,/stl, $(INCLUDE))
-
-.ENDIF
-.INCLUDE : tg_wntx64.mk
-
diff --git a/shell/source/all/zipfile/zipexcptn.cxx b/shell/source/all/zipfile/zipexcptn.cxx
deleted file mode 100644
index 5a5dcef..0000000
--- a/shell/source/all/zipfile/zipexcptn.cxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "internal/global.hxx"
-#include "zipexcptn.hxx"
-
-//------------------------------------------
-/**
-*/
-RuntimeException::RuntimeException(int Error) :
- m_Error(Error)
-{
-}
-
-//------------------------------------------
-/**
-*/
-RuntimeException::~RuntimeException() throw()
-{
-}
-
-//------------------------------------------
-/**
-*/
-int RuntimeException::GetErrorCode() const
-{
- return m_Error;
-}
-
-//------------------------------------------
-/**
-*/
-ZipException::ZipException(int Error) :
- RuntimeException(Error)
-{
-}
-
-//------------------------------------------
-/**
-*/
-const char* ZipException::what() const throw()
-{
- return 0;
-}
-
-//------------------------------------------
-/**
-*/
-Win32Exception::Win32Exception(int Error) :
- RuntimeException(Error),
- m_MsgBuff(0)
-{
-}
-
-//------------------------------------------
-/**
-*/
-Win32Exception::~Win32Exception() throw()
-{
- if (m_MsgBuff)
- LocalFree(m_MsgBuff);
-}
-
-//------------------------------------------
-/**
-*/
-const char* Win32Exception::what() const throw()
-{
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- GetErrorCode(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR) &m_MsgBuff,
- 0,
- NULL);
-
- return reinterpret_cast<char*>(m_MsgBuff);
-}
-
-//------------------------------------------
-/**
-*/
-ZipContentMissException::ZipContentMissException(int Error) :
- ZipException(Error)
-{
-}
-
-//------------------------------------------
-/**
-*/
-AccessViolationException::AccessViolationException(int Error) :
- Win32Exception(Error)
-{
-}
-
-//------------------------------------------
-/**
-*/
-IOException::IOException(int Error) :
- Win32Exception(Error)
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/zipfile/zipexcptn.hxx b/shell/source/all/zipfile/zipexcptn.hxx
deleted file mode 100644
index 0b63544..0000000
--- a/shell/source/all/zipfile/zipexcptn.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-// ZipException.h: interface for the ZipException class.
-
-#ifndef ZIPEXCPTN_HXX_INCLUDED
-#define ZIPEXCPTN_HXX_INCLUDED
-
-#include <stdexcept>
-
-//------------------------------------------
-/**
-*/
-class RuntimeException : public std::exception
-{
-public:
- RuntimeException(int Error);
- virtual ~RuntimeException() throw();
-
- int GetErrorCode() const;
-
-private:
- int m_Error;
-};
-
-//------------------------------------------
-/**
-*/
-class ZipException : public RuntimeException
-{
-public:
- ZipException(int Error);
-
- virtual const char* what() const throw();
-};
-
-//------------------------------------------
-/**
-*/
-class Win32Exception : public RuntimeException
-{
-public:
- Win32Exception(int Error);
- virtual ~Win32Exception() throw();
-
- virtual const char* what() const throw();
-
-private:
- void* m_MsgBuff;
-};
-
-//------------------------------------------
-/**
-*/
-class ZipContentMissException : public ZipException
-{
-public:
- ZipContentMissException(int Error);
-};
-
-//------------------------------------------
-/**
-*/
-class AccessViolationException : public Win32Exception
-{
-public:
- AccessViolationException(int Error);
-};
-
-//------------------------------------------
-/**
-*/
-class IOException : public Win32Exception
-{
-public:
- IOException(int Error);
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/all/zipfile/zipfile.cxx b/shell/source/all/zipfile/zipfile.cxx
deleted file mode 100644
index c7ed65e..0000000
--- a/shell/source/all/zipfile/zipfile.cxx
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "zipexcptn.hxx"
-#include "internal/zipfile.hxx"
-#include "internal/global.hxx"
-
-#include <malloc.h>
-#include <algorithm>
-#include <functional>
-
-#include <string.h>
-
-namespace internal
-{
- /* for case in-sensitive string comparison */
- struct stricmp : public std::unary_function<std::string, bool>
- {
- stricmp(const std::string& str) : str_(str)
- {}
-
- bool operator() (const std::string& other)
- { return (0 == _stricmp(str_.c_str(), other.c_str())); }
-
- std::string str_;
- };
-} // namespace internal
-
-/** Checks whether a file is a zip file or not
-
- @precond The given parameter must be a string with length > 0
- The file must exist
- The file must be readable for the current user
-
- @returns true if the file is a zip file
- false if the file is not a zip file
-
- @throws ParameterException if the given file name is empty
- IOException if the specified file doesn't exist
- AccessViolationException if read access to the file is denied
-*/
-bool ZipFile::IsZipFile(const std::string& /*FileName*/)
-{
- return true;
-}
-
-bool ZipFile::IsZipFile(void* /*stream*/)
-{
- return true;
-}
-
-
-/** Returns wheter the version of the specified zip file may be uncompressed with the
- currently used zlib version or not
-
- @precond The given parameter must be a string with length > 0
- The file must exist
- The file must be readable for the current user
- The file must be a valid zip file
-
- @returns true if the file may be uncompressed with the currently used zlib
- false if the file may not be uncompressed with the currently used zlib
-
- @throws ParameterException if the given file name is empty
- IOException if the specified file doesn't exist or is no zip file
- AccessViolationException if read access to the file is denied
-*/
-bool ZipFile::IsValidZipFileVersionNumber(const std::string& /*FileName*/)
-{
- return true;
-}
-
-bool ZipFile::IsValidZipFileVersionNumber(void* /* stream*/)
-{
- return true;
-}
-
-
-/** Constructs a zip file from a zip file
-
- @precond The given parameter must be a string with length > 0
- The file must exist
- The file must be readable for the current user
-
- @throws ParameterException if the given file name is empty
- IOException if the specified file doesn't exist or is no valid zip file
- AccessViolationException if read access to the file is denied
- WrongZipVersionException if the zip file cannot be uncompressed
- with the used zlib version
-*/
-ZipFile::ZipFile(const std::string& FileName)
-{
- m_uzFile = unzOpen(FileName.c_str());
-
- if (0 == m_uzFile)
- throw IOException(-1);
-}
-
-ZipFile::ZipFile(void* stream, zlib_filefunc_def* fa)
-{
- fa->opaque = stream;
- m_uzFile = unzOpen2((const char *)NULL, fa);
-
- if (0 == m_uzFile)
- throw IOException(-1);
-}
-
-
-/** Destroys a zip file
-*/
-ZipFile::~ZipFile()
-{
- unzClose(m_uzFile);
-}
-
-/** Provides an interface to read the uncompressed data of a content of the zip file
-
- @precond The specified content must exist in this file
- ppstm must not be NULL
-*/
-void ZipFile::GetUncompressedContent(
- const std::string& ContentName, /*inout*/ ZipContentBuffer_t& ContentBuffer)
-{
- int rc = unzLocateFile(m_uzFile, ContentName.c_str(), 0);
-
- if (UNZ_END_OF_LIST_OF_FILE == rc)
- throw ZipContentMissException(rc);
-
- unz_file_info finfo;
- unzGetCurrentFileInfo(m_uzFile, &finfo, 0, 0, 0, 0, 0, 0);
-
- ContentBuffer.resize(finfo.uncompressed_size);
-
- rc = unzOpenCurrentFile(m_uzFile);
-
- if (UNZ_OK != rc)
- throw ZipException(rc);
-
- rc = unzReadCurrentFile(m_uzFile, &ContentBuffer[0], finfo.uncompressed_size);
-
- if (rc < 0)
- throw ZipException(rc);
-
- rc = unzCloseCurrentFile(m_uzFile);
-
- if (rc < 0)
- throw ZipException(rc);
-}
-
-/** Returns a list with the content names contained within this file
-
-*/
-ZipFile::DirectoryPtr_t ZipFile::GetDirectory() const
-{
- DirectoryPtr_t dir(new Directory_t());
-
- long lmax = GetFileLongestFileNameLength() + 1;
- char* szFileName = reinterpret_cast<char*>(_alloca(lmax));
-
- if (!szFileName)
- throw ZipException(ERROR_NOT_ENOUGH_MEMORY);
-
- int rc = unzGoToFirstFile(m_uzFile);
-
- while (UNZ_OK == rc && UNZ_END_OF_LIST_OF_FILE != rc)
- {
- unzGetCurrentFileInfo(
- m_uzFile, 0, szFileName, lmax, 0, 0, 0, 0);
-
- dir->push_back(szFileName);
-
- rc = unzGoToNextFile(m_uzFile);
- }
-
- if (UNZ_OK != rc && UNZ_END_OF_LIST_OF_FILE != rc)
- throw ZipException(rc);
-
- return dir;
-}
-
-/** Convinience query function may even realized with
- iterating over a ZipFileDirectory returned by
- GetDirectory */
-bool ZipFile::HasContent(const std::string& ContentName) const
-{
- //#i34314# we need to compare package content names
- //case in-sensitive as it is not defined that such
- //names must be handled case sensitive
- DirectoryPtr_t dir = GetDirectory();
- Directory_t::iterator iter =
- std::find_if(dir->begin(), dir->end(), internal::stricmp(ContentName));
-
- return (iter != dir->end());
-}
-
-
-/** Returns the length of the longest file name
- in the current zip file
-*/
-long ZipFile::GetFileLongestFileNameLength() const
-{
- long lmax = 0;
- unz_file_info finfo;
-
- int rc = unzGoToFirstFile(m_uzFile);
-
- while (UNZ_OK == rc && UNZ_END_OF_LIST_OF_FILE != rc)
- {
- unzGetCurrentFileInfo(m_uzFile, &finfo, 0, 0, 0, 0, 0, 0);
- lmax = std::max<long>(lmax, finfo.size_filename);
- rc = unzGoToNextFile(m_uzFile);
- }
-
- if (UNZ_OK != rc && UNZ_END_OF_LIST_OF_FILE != rc)
- throw ZipException(rc);
-
- return lmax;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/ooofilereader/autostyletag.cxx b/shell/source/win32/ooofilereader/autostyletag.cxx
new file mode 100644
index 0000000..3cf81a7
--- /dev/null
+++ b/shell/source/win32/ooofilereader/autostyletag.cxx
@@ -0,0 +1,102 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+#include "autostyletag.hxx"
+
+/*********************** CAutoStyleTag ***********************/
+
+CAutoStyleTag::CAutoStyleTag( const XmlTagAttributes_t& attributes ):
+ m_CurrentStyleLocalePair( EMPTY_STYLELOCALE_PAIR )
+{
+ addAttributes( attributes);
+};
+
+void CAutoStyleTag::startTag()
+{
+}
+
+void CAutoStyleTag::endTag()
+{
+}
+
+void CAutoStyleTag::addCharacters(const std::wstring&)
+{
+}
+
+void CAutoStyleTag::addAttributes(const XmlTagAttributes_t& attributes)
+{
+ if ( EMPTY_STYLELOCALE_PAIR == m_CurrentStyleLocalePair )
+ {
+ // the style-locale pair should be empty when entering STYLE_STYLE
+ // tag, and otherwise should be STYLE_PROPERTIES.
+
+ XmlTagAttributes_t::const_iterator iter = attributes.find(CONTENT_STYLE_STYLE_NAME);
+
+ if ( iter != attributes.end())
+ setStyle( iter->second );
+ }
+ else
+ {
+ // tag STYLE_PROPERTIES entered.
+
+ XmlTagAttributes_t::const_iterator iter_lan = attributes.find(CONTENT_STYLE_PROPERTIES_LANGUAGE);
+ XmlTagAttributes_t::const_iterator iter_con = attributes.find(CONTENT_STYLE_PROPERTIES_COUNTRY);
+ XmlTagAttributes_t::const_iterator iter_lan_asain = attributes.find(CONTENT_STYLE_PROPERTIES_LANGUAGEASIAN);
+ XmlTagAttributes_t::const_iterator iter_con_asain = attributes.find(CONTENT_STYLE_PROPERTIES_COUNTRYASIAN);
+
+ // if style:properties | fo:language or style:language-asian is exist,
+ // set the locale field, otherwise clear the style-locale pair;
+ if ( ( iter_lan!= attributes.end() ) && ( iter_con != attributes.end() ) )
+ setLocale( ::std::make_pair( iter_lan->second,iter_con->second ) );
+ else if ( ( iter_lan_asain!= attributes.end() ) && ( iter_con_asain != attributes.end() ) )
+ setLocale( ::std::make_pair( iter_lan_asain->second,iter_con_asain->second ) );
+ else
+ clearStyleLocalePair();
+ }
+
+}
+
+void CAutoStyleTag::setStyle( ::std::wstring const & Style )
+{
+ m_CurrentStyleLocalePair.first = Style;
+}
+
+void CAutoStyleTag::setLocale( LocaleSet_t Locale )
+{
+ m_CurrentStyleLocalePair.second = Locale;
+}
+
+void CAutoStyleTag::clearStyleLocalePair( )
+{
+ m_CurrentStyleLocalePair = EMPTY_STYLELOCALE_PAIR;
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/ooofilereader/autostyletag.hxx b/shell/source/win32/ooofilereader/autostyletag.hxx
new file mode 100644
index 0000000..c392b53
--- /dev/null
+++ b/shell/source/win32/ooofilereader/autostyletag.hxx
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#ifndef AUTOSTYLETAG_HXX_INCLUDED
+#define AUTOSTYLETAG_HXX_INCLUDED
+
+#include "itag.hxx"
+
+/*************************** CAutoStyleTag tag readers ***************************/
+
+/** Implements the ITag interface for
+ building a Style-Locale list
+
+ Usage sample:
+
+ LocaleSet_t locale = meta_info_accessor.getDefaultLocale();
+ CContentReader content( m_szFileName, locale );
+ CStyleMap map = content.getStyleMap();
+*/
+class CAutoStyleTag : public ITag
+{
+ public:
+ CAutoStyleTag():m_CurrentStyleLocalePair( EMPTY_STYLELOCALE_PAIR ){};
+ CAutoStyleTag( const XmlTagAttributes_t& attributes );
+
+ virtual void startTag();
+ virtual void endTag();
+ virtual void addCharacters(const std::wstring& characters);
+ virtual void addAttributes(const XmlTagAttributes_t& attributes);
+ virtual std::wstring getTagContent(){ return EMPTY_STRING; };
+ virtual ::std::wstring const getTagAttribute( ::std::wstring const & /*attrname*/ ){ return ::std::wstring() ; };
+
+ void setStyle( ::std::wstring const & Style );
+ void setLocale( LocaleSet_t Locale );
+ void clearStyleLocalePair( void );
+ inline StyleLocalePair_t getStyleLocalePair() const{ return m_CurrentStyleLocalePair; };
+ inline bool isFull() const
+ {
+ return (( m_CurrentStyleLocalePair.first != EMPTY_STRING )&&
+ ( m_CurrentStyleLocalePair.second != EMPTY_LOCALE));
+ };
+
+ private:
+ StyleLocalePair_t m_CurrentStyleLocalePair;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/ooofilereader/basereader.cxx b/shell/source/win32/ooofilereader/basereader.cxx
new file mode 100644
index 0000000..1b8c139
--- /dev/null
+++ b/shell/source/win32/ooofilereader/basereader.cxx
@@ -0,0 +1,102 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+#include <osl/diagnose.h>
+
+#include "internal/basereader.hxx"
+
+#include "internal/xml_parser.hxx"
+
+#include "assert.h"
+#include <memory>
+
+/** constructor of CBaseReader.
+*/
+CBaseReader::CBaseReader(const std::string& DocumentName):
+m_ZipFile( DocumentName )
+{
+}
+
+//------------------------------
+
+CBaseReader::CBaseReader(void * sw, zlib_filefunc_def* fa):
+m_ZipFile( sw , fa )
+{
+}
+
+//------------------------------
+
+CBaseReader::~CBaseReader()
+{
+}
+
+//------------------------------
+
+void CBaseReader::start_document()
+{
+}
+
+//------------------------------
+
+void CBaseReader::end_document()
+{
+}
+
+/** Read interested tag content into respective structure then start parsing process.
+ @param ContentName
+ the xml file name in the zipped document which we interest.
+*/
+void CBaseReader::Initialize( const std::string& ContentName)
+{
+ try
+ {
+ if (m_ZipContent.empty())
+ m_ZipFile.GetUncompressedContent( ContentName, m_ZipContent );
+
+ xml_parser parser;
+ parser.set_document_handler(this); // pass current reader as reader to the sax parser
+ parser.parse(&m_ZipContent[0], m_ZipContent.size());
+ }
+ catch(std::exception&
+ #if OSL_DEBUG_LEVEL > 0
+ ex
+ #endif
+ )
+ {
+ OSL_ENSURE( false, ex.what() );
+ }
+ catch(...)
+ {
+ OSL_ENSURE(false, "Unknown error");
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/ooofilereader/contentreader.cxx b/shell/source/win32/ooofilereader/contentreader.cxx
new file mode 100644
index 0000000..e021383
--- /dev/null
+++ b/shell/source/win32/ooofilereader/contentreader.cxx
@@ -0,0 +1,240 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+#include <osl/diagnose.h>
+
+#include "internal/contentreader.hxx"
+#include "dummytag.hxx"
+#include "simpletag.hxx"
+#include "autostyletag.hxx"
+
+#include "assert.h"
+
+/** constructor.
+*/
+CContentReader::CContentReader( const std::string& DocumentName, LocaleSet_t const & DocumentLocale ):
+CBaseReader( DocumentName )
+{
+ try
+ {
+ m_DefaultLocale = DocumentLocale;
+ Initialize( DOC_CONTENT_NAME );
+ }
+ catch(xml_parser_exception&
+ #if OSL_DEBUG_LEVEL > 0
+ ex
+ #endif
+ )
+ {
+ OSL_ENSURE(false, ex.what());
+ }
+ catch(...)
+ {
+ OSL_ENSURE(false, "Unknown error");
+ }
+}
+
+CContentReader::CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa ) :
+CBaseReader( stream, fa )
+{
+try
+ {
+ m_DefaultLocale = DocumentLocale;
+ Initialize( DOC_CONTENT_NAME );
+ }
+ catch(xml_parser_exception&
+ #if OSL_DEBUG_LEVEL > 0
+ ex
+ #endif
+ )
+ {
+ OSL_ENSURE(false, ex.what());
+ }
+ catch(...)
+ {
+ OSL_ENSURE(false, "Unknown error");
+ }
+}
+
+
+/** destructor.
+*/
+
+CContentReader::~CContentReader( void )
+{
+}
+
+/*********************** helper functions ***********************/
+
+/** choose an appropriate tag reader
+*/
+
+ITag* CContentReader::chooseTagReader( const std::wstring& tag_name, const XmlTagAttributes_t& XmlAttributes )
+{
+ if (( tag_name == CONTENT_TEXT_A )||( tag_name == CONTENT_TEXT_P )||
+ ( tag_name == CONTENT_TEXT_SPAN ) ||( tag_name == CONTENT_TEXT_H )||
+ ( tag_name == CONTENT_TEXT_SEQUENCE ) ||( tag_name == CONTENT_TEXT_BOOKMARK_REF )||
+ ( tag_name == CONTENT_TEXT_INDEX_TITLE_TEMPLATE ) )
+ return new CSimpleTag(XmlAttributes);
+ else if ( tag_name == CONTENT_STYLE_STYLE )
+ {
+ // if style:style | style:name is exist,, fill the style field, otherwise do nothing;
+ if ( XmlAttributes.find(CONTENT_STYLE_STYLE_NAME) != XmlAttributes.end())
+ return new CAutoStyleTag(XmlAttributes);
+ else
+ return new CDummyTag();
+ }
+ else if ( ( tag_name == CONTENT_STYLE_PROPERTIES ) || ( tag_name == CONTENT_TEXT_STYLE_PROPERTIES ) )
+ {
+ assert( !m_TagBuilderStack.empty() );
+
+ //here we presume that if CONTENT_STYLE_PROPERTIES tag is present, it just follow CONTENT_STYLE_STYLE;
+ ITag* pTagBuilder = m_TagBuilderStack.top();
+ pTagBuilder->addAttributes( XmlAttributes );
+
+ return new CDummyTag();
+ }
+ else
+ return new CDummyTag();
+}
+
+/** get style of the current content.
+*/
+::std::wstring CContentReader::getCurrentContentStyle( void )
+{
+ assert( !m_TagBuilderStack.empty() );
+ ITag* pTagBuilder = m_TagBuilderStack.top();
+
+ return ( pTagBuilder->getTagAttribute(CONTENT_TEXT_STYLENAME) );
+}
+
+/** add chunk into Chunk Buffer.
+*/
+void CContentReader::addChunk( LocaleSet_t const & Locale, Content_t const & Content )
+{
+ if ( Content == EMPTY_STRING )
+ return;
+
+ if ( ( ( m_ChunkBuffer.empty() ) || ( m_ChunkBuffer.back().first != Locale ) ) &&
+ ( ( Content != SPACE ) && ( Content != LF ) ) )
+ {
+ // if met a new locale, add a blank new chunk;
+ Chunk_t Chunk;
+ Chunk.first = Locale;
+ Chunk.second = EMPTY_STRING;
+ m_ChunkBuffer.push_back( Chunk );
+ }
+
+ if ( !m_ChunkBuffer.empty() )
+ m_ChunkBuffer.back().second += Content;
+}
+
+/** get a style's locale field.
+*/
+
+LocaleSet_t const & CContentReader::getLocale( const StyleName_t Style )
+{
+ if ( m_StyleMap.empty() )
+ return m_DefaultLocale;
+
+ StyleLocaleMap_t :: const_iterator style_Iter;
+
+ if ( ( style_Iter = m_StyleMap.find( Style ) ) == m_StyleMap.end( ) )
+ return m_DefaultLocale;
+ else
+ return style_Iter->second;
+
+}
+
+/*********************** event handler functions ***********************/
+
+//------------------------------
+// start_element occurs when a tag is start
+//------------------------------
+
+void CContentReader::start_element(
+ const std::wstring& /*raw_name*/,
+ const std::wstring& local_name,
+ const XmlTagAttributes_t& attributes)
+{
+ //get appropriate Xml Tag Builder using MetaInfoBuilderFactory;
+ ITag* pTagBuilder = chooseTagReader( local_name,attributes );
+ assert( pTagBuilder != NULL );
+ pTagBuilder->startTag( );
+ m_TagBuilderStack.push( pTagBuilder );
+
+}
+
+//------------------------------
+// end_element occurs when a tag is closed
+//------------------------------
+
+void CContentReader::end_element(const std::wstring& /*raw_name*/, const std::wstring& local_name)
+{
+ assert( !m_TagBuilderStack.empty() );
+ ITag* pTagBuilder = m_TagBuilderStack.top();
+
+ if ( local_name == CONTENT_STYLE_STYLE )
+ {
+ StyleLocalePair_t StyleLocalePair = static_cast<CAutoStyleTag * >( pTagBuilder)->getStyleLocalePair();
+ if ( ( static_cast<CAutoStyleTag * >( pTagBuilder)->isFull() ) && ( StyleLocalePair.second != m_DefaultLocale ) )
+ m_StyleMap.insert( StyleLocalePair );
+ }
+ if (( local_name == CONTENT_TEXT_A )||( local_name == CONTENT_TEXT_SPAN ) ||
+ ( local_name == CONTENT_TEXT_SEQUENCE )||( local_name == CONTENT_TEXT_BOOKMARK_REF ))
+ addChunk( getLocale( getCurrentContentStyle() ), ::std::wstring( SPACE ) );
+ if ((( local_name == CONTENT_TEXT_P )||( local_name == CONTENT_TEXT_H ) ||
+ ( local_name == CONTENT_TEXT_INDEX_TITLE_TEMPLATE ) )&&
+ ( EMPTY_STRING != pTagBuilder->getTagContent( ) ) )
+ addChunk( getLocale( getCurrentContentStyle() ), ::std::wstring( LF ) );
+
+ m_TagBuilderStack.pop();
+ pTagBuilder->endTag();
+ delete pTagBuilder;
+
+}
+
+//------------------------------
+// characters occurs when receiving characters
+//------------------------------
+
+void CContentReader::characters( const std::wstring& character )
+{
+ if ( character.length() > 0 && !HasOnlySpaces( character ) )
+ {
+ addChunk( getLocale( getCurrentContentStyle() ), ::std::wstring( character ) );
+
+ ITag* pTagBuilder = m_TagBuilderStack.top();
+ pTagBuilder->addCharacters( character );
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/ooofilereader/dummytag.hxx b/shell/source/win32/ooofilereader/dummytag.hxx
new file mode 100644
index 0000000..b7007f5
--- /dev/null
+++ b/shell/source/win32/ooofilereader/dummytag.hxx
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#ifndef DUMMYTAG_HXX_INCLUDED
+#define DUMMYTAG_HXX_INCLUDED
+
+#include "itag.hxx"
+
+/*************************** dummy tag readers ***************************/
+
+/** Implements the ITag interface but does
+ nothing (Null object pattern), may be used for
+ tags we are not interessted in to avoid if-else
+ branches.
+*/
+class CDummyTag : public ITag
+{
+ public:
+ virtual void startTag(){};
+
+ virtual void endTag(){};
+
+ virtual void addCharacters(const std::wstring& /*characters*/){};
+
+ virtual void addAttributes(const XmlTagAttributes_t& /*attributes*/){};
+
+ virtual std::wstring getTagContent( void )
+ {
+ return EMPTY_STRING;
+ };
+
+ virtual ::std::wstring const getTagAttribute( ::std::wstring const & /*attrname*/ ){ return ::std::wstring(EMPTY_STRING); };
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/ooofilereader/itag.hxx b/shell/source/win32/ooofilereader/itag.hxx
new file mode 100644
index 0000000..c4a7eea
--- /dev/null
+++ b/shell/source/win32/ooofilereader/itag.hxx
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#ifndef ITAG_HXX_INCLUDED
+#define ITAG_HXX_INCLUDED
+
+#include "internal/config.hxx"
+#include "internal/types.hxx"
+
+/*************************** interface of tag readers ***************************/
+
+/** Interface for a xml tag character builder
+*/
+class ITag
+{
+ public:
+ virtual ~ITag() {};
+
+ virtual void startTag() = 0;
+ virtual void endTag() = 0;
+ virtual void addCharacters(const std::wstring& characters) = 0;
+ virtual void addAttributes(const XmlTagAttributes_t& attributes) = 0;
+ virtual ::std::wstring getTagContent( void ) = 0;
+ virtual ::std::wstring const getTagAttribute( ::std::wstring const & attrname ) = 0;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/ooofilereader/keywordstag.cxx b/shell/source/win32/ooofilereader/keywordstag.cxx
new file mode 100644
index 0000000..695bfe8
--- /dev/null
+++ b/shell/source/win32/ooofilereader/keywordstag.cxx
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+#include "keywordstag.hxx"
+
+/*********************** CKeywordsTag ***********************/
+
+void CKeywordsTag::startTag()
+{
+ m_sCurrentKeyword.clear();
+}
+
+void CKeywordsTag::endTag()
+{
+ m_slKeywords.push_back(m_sCurrentKeyword);
+}
+
+void CKeywordsTag::addCharacters(const std::wstring& characters)
+{
+ m_sCurrentKeyword += characters;
+}
+
+void CKeywordsTag::addAttributes(const XmlTagAttributes_t& /*attributes*/)
+{
+ // there are no attributes for keywords
+}
+
+std::wstring CKeywordsTag::getTagContent( )
+{
+ StringList_t::const_iterator keywords_Iter= m_slKeywords.begin( );
+ StringList_t::const_iterator keywords_Iter_end = m_slKeywords.end( );
+
+ std::wstring ret_KeyWord_String = ( keywords_Iter != keywords_Iter_end) ? *keywords_Iter++ : L"";
+ for ( ; keywords_Iter != keywords_Iter_end; ++keywords_Iter)
+ ret_KeyWord_String += L"," + *keywords_Iter;
+ return ret_KeyWord_String;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/ooofilereader/keywordstag.hxx b/shell/source/win32/ooofilereader/keywordstag.hxx
new file mode 100644
index 0000000..9a761ac
--- /dev/null
+++ b/shell/source/win32/ooofilereader/keywordstag.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#ifndef KEYWORDSTAG_HXX_INCLUDED
+#define KEYWORDSTAG_HXX_INCLUDED
+
+#include "itag.hxx"
+
+/*************************** metainfo tag readers ***************************/
+
+/** Implements the ITag interface for
+ building a keyword list
+*/
+class CKeywordsTag : public ITag
+{
+ public:
+ virtual void startTag();
+ virtual void endTag();
+ virtual void addCharacters(const std::wstring& characters);
+ virtual void addAttributes(const XmlTagAttributes_t& attributes);
+ virtual std::wstring getTagContent();
+ virtual ::std::wstring const getTagAttribute( ::std::wstring const & /*attrname*/ ){ return ::std::wstring(); };
+
+ private:
+ StringList_t m_slKeywords;
+ std::wstring m_sCurrentKeyword;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/ooofilereader/makefile.mk b/shell/source/win32/ooofilereader/makefile.mk
new file mode 100755
index 0000000..90f0429
--- /dev/null
+++ b/shell/source/win32/ooofilereader/makefile.mk
@@ -0,0 +1,88 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJNAME=shell
+TARGET=ooofilereader
+LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
+
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501
+.IF "$(COM)" == "MSC"
+CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820
+.ENDIF
+CDEFS+=-D_WIN32_IE=0x501
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list