Remove useless IXFContent

Change-Id: I727ae1c4a2c1a0c321580a9a8948c48ee9bbfcab
This commit is contained in:
Stephan Bergmann
2014-06-11 15:36:29 +02:00
parent 5b1002fa2a
commit 4d7ddfa1a8
14 changed files with 73 additions and 146 deletions

View File

@@ -1,97 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library 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 for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: IBM Corporation
*
* Copyright: 2008 by IBM Corporation
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
/*************************************************************************
* @file
* Interface for the all content object,ie. text,paragraph,picture,and so on.
************************************************************************/
#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_IXFCONTENT_HXX
#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_IXFCONTENT_HXX
#include "xfglobal.hxx"
/**
* @brief Base interface for all content object.Implementation classes include text span,paragraph,
Drawing objects, image, ole and so on.
*/
class IXFContent : public IXFObject
{
public:
virtual ~IXFContent(){}
/**
* @descr Fetch the content type,not quite useful.
*/
virtual enumXFContent GetContentType() = 0;
/**
* @descr Set style to apply. You can get the style name by use XFStyleManager::AddStyle(pStyle),
* or just set a fixed style name.
*/
virtual void SetStyleName(const OUString& style) = 0;
/**
* @descr return the style name.
*/
virtual OUString GetStyleName() = 0;
/**
* @descr Deep copy.
*/
virtual IXFContent* Clone() = 0;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -80,7 +80,7 @@ public:
* The funciton to serial the object to the sax stream.
* The objects that must implements ToXml is divided into two types:
* 1. IXFStyle objects that has something to do with styles.
* 2. IXFContent objects that contents text or picture.
* 2. XFContent objects that contents text or picture.
*/
virtual void ToXml(IXFStream *pSaxStream) = 0;
};

View File

@@ -121,7 +121,7 @@ XFCell::~XFCell()
delete m_pSubTable;
}
void XFCell::Add(IXFContent *pContent)
void XFCell::Add(XFContent *pContent)
{
if( m_eValueType != enumXFValueTypeNone )
{

View File

@@ -88,7 +88,7 @@ public:
/**
* @descr Add content for table cell.
*/
void Add(IXFContent *pContent) SAL_OVERRIDE;
void Add(XFContent *pContent) SAL_OVERRIDE;
/**
* @descr If cell spans more the one column, then set column span.

View File

@@ -60,36 +60,45 @@
#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_XFCONTENT_HXX
#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_XFCONTENT_HXX
#include "ixfcontent.hxx"
#include <sal/config.h>
#include <rtl/ustring.hxx>
#include "ixfobject.hxx"
#include "xfdefs.hxx"
/**
* @descr
* Base class for all content object.
* There is only two properties:style name and content type in this class.
*/
class XFContent : public IXFContent
class XFContent : public IXFObject
{
public:
virtual ~XFContent() {}
/**
* @short: return the content type.
*/
virtual enumXFContent GetContentType() SAL_OVERRIDE { return enumXFContentUnknown; }
virtual enumXFContent GetContentType() { return enumXFContentUnknown; }
/**
* @short: All content except XFTextContent can have a style.
*/
virtual void SetStyleName(const OUString& style) SAL_OVERRIDE {m_strStyleName = style;}
virtual void SetStyleName(const OUString& style) {m_strStyleName = style;}
/**
* @short: return the style name.
*/
virtual OUString GetStyleName() SAL_OVERRIDE {return m_strStyleName;}
OUString GetStyleName() {return m_strStyleName;}
/**
*/
virtual IXFContent* Clone() SAL_OVERRIDE {return NULL;}
XFContent* Clone() {return NULL;}
protected:
XFContent() {}
OUString m_strStyleName;
};

View File

@@ -66,14 +66,14 @@ XFContentContainer::XFContentContainer()
XFContentContainer::XFContentContainer(const XFContentContainer& other):XFContent(other)
{
std::vector<IXFContent*>::const_iterator it;
std::vector<XFContent*>::const_iterator it;
for( it = other.m_aContents.begin(); it != other.m_aContents.end(); ++it )
{
IXFContent *pContent = *it;
XFContent *pContent = *it;
if( pContent )
{
IXFContent *pClone = pContent->Clone();
XFContent *pClone = pContent->Clone();
if( pClone )
Add(pClone);
}
@@ -82,14 +82,14 @@ XFContentContainer::XFContentContainer(const XFContentContainer& other):XFConten
XFContentContainer& XFContentContainer::operator=(const XFContentContainer& other)
{
std::vector<IXFContent*>::const_iterator it;
std::vector<XFContent*>::const_iterator it;
for( it = other.m_aContents.begin(); it != other.m_aContents.end(); ++it )
{
IXFContent *pContent = *it;
XFContent *pContent = *it;
if( pContent )
{
IXFContent *pClone = pContent->Clone();
XFContent *pClone = pContent->Clone();
if( pClone )
Add(pClone);
}
@@ -99,21 +99,21 @@ XFContentContainer& XFContentContainer::operator=(const XFContentContainer& othe
XFContentContainer::~XFContentContainer()
{
std::vector<IXFContent*>::iterator it;
std::vector<XFContent*>::iterator it;
for( it = m_aContents.begin(); it != m_aContents.end(); ++it )
{
IXFContent *pContent = *it;
XFContent *pContent = *it;
delete pContent;
}
}
void XFContentContainer::Add(IXFContent *pContent)
void XFContentContainer::Add(XFContent *pContent)
{
m_aContents.push_back(pContent);
}
void XFContentContainer::InsertAtBegin(IXFContent * pContent)
void XFContentContainer::InsertAtBegin(XFContent * pContent)
{
m_aContents.insert(m_aContents.begin(), pContent);
}
@@ -135,21 +135,21 @@ int XFContentContainer::GetCount() const
void XFContentContainer::Reset()
{
std::vector<IXFContent*>::iterator it;
std::vector<XFContent*>::iterator it;
for( it = m_aContents.begin(); it != m_aContents.end(); ++it )
{
IXFContent *pContent = *it;
XFContent *pContent = *it;
if( pContent )
delete pContent;
}
m_aContents.clear();
}
IXFContent* XFContentContainer::FindFirstContent(enumXFContent type)
XFContent* XFContentContainer::FindFirstContent(enumXFContent type)
{
IXFContent *pRet = NULL;
IXFContent *pContent = NULL;
XFContent *pRet = NULL;
XFContent *pContent = NULL;
for( int i=0; i<GetCount(); i++ )
{
@@ -181,17 +181,17 @@ enumXFContent XFContentContainer::GetContentType()
void XFContentContainer::ToXml(IXFStream *pStrm)
{
std::vector<IXFContent*>::iterator it;
std::vector<XFContent*>::iterator it;
for( it = m_aContents.begin(); it != m_aContents.end(); ++it )
{
IXFContent *pContent = *it;
XFContent *pContent = *it;
if( pContent )
pContent->ToXml(pStrm);
}
}
IXFContent* XFContentContainer::GetLastContent()
XFContent* XFContentContainer::GetLastContent()
{
sal_uInt32 index = m_aContents.size()-1;
if(index >0)

View File

@@ -86,11 +86,11 @@ public:
/**
* @descr Add conent.
*/
virtual void Add(IXFContent *pContent);
virtual void Add(XFContent *pContent);
virtual void InsertAtBegin(IXFContent *pContent);
virtual void InsertAtBegin(XFContent *pContent);
virtual void RemoveAt(sal_uInt32 nPos);
virtual IXFContent* GetLastContent();
virtual XFContent* GetLastContent();
virtual void RemoveLastContent();
/**
* @descr convience function for add text content.
@@ -105,7 +105,7 @@ public:
/**
* @descr get content by index.
*/
IXFContent* GetContent(sal_uInt32 index) const;
XFContent* GetContent(sal_uInt32 index) const;
/**
* @descr clear all contents in the container.
@@ -115,7 +115,7 @@ public:
/**
* @descr helper function, find first content by type.
*/
IXFContent* FindFirstContent(enumXFContent type);
XFContent* FindFirstContent(enumXFContent type);
/**
* @descr return the content type.
@@ -127,10 +127,10 @@ public:
virtual void ToXml(IXFStream *pStrm) SAL_OVERRIDE;
private:
std::vector<IXFContent*> m_aContents;
std::vector<XFContent*> m_aContents;
};
inline IXFContent* XFContentContainer::GetContent(sal_uInt32 index) const
inline XFContent* XFContentContainer::GetContent(sal_uInt32 index) const
{
if (index > m_aContents.size()-1)
return NULL;

View File

@@ -57,6 +57,11 @@
* @file
* index entry object.
************************************************************************/
#include <sal/config.h>
#include "ixfattrlist.hxx"
#include "ixfstream.hxx"
#include "xfcrossref.hxx"
XFCrossRefStart::XFCrossRefStart()

View File

@@ -57,6 +57,11 @@
* @file
* index entry object.
************************************************************************/
#include <sal/config.h>
#include "ixfattrlist.hxx"
#include "ixfstream.hxx"
#include "xfentry.hxx"
XFEntry::XFEntry()

View File

@@ -90,7 +90,7 @@ XFFrame::~XFFrame()
{
}
void XFFrame::Add(IXFContent *pContent)
void XFFrame::Add(XFContent *pContent)
{
if (!pContent)
return;
@@ -194,7 +194,7 @@ void XFFrame::AdjustZIndex()
{
for( int i=0; i<GetCount(); i++ )
{
IXFContent *pContent = GetContent(i);
XFContent *pContent = GetContent(i);
if( pContent )
{
if( pContent->GetContentType() == enumXFContentFrame )

View File

@@ -90,7 +90,7 @@ public:
/**
* @descr override the add function to adjust z-index.
*/
virtual void Add(IXFContent *pContent) SAL_OVERRIDE;
virtual void Add(XFContent *pContent) SAL_OVERRIDE;
/**
* @descr: Set the anchor type for the frame object.

View File

@@ -57,6 +57,11 @@
* @file
* Table object.
************************************************************************/
#include <sal/config.h>
#include "ixfattrlist.hxx"
#include "ixfstream.hxx"
#include "xfrow.hxx"
#include "xfcell.hxx"
#include "xftable.hxx"

View File

@@ -77,10 +77,10 @@ XFTextSpan::XFTextSpan(const OUString& text,
XFTextSpan::~XFTextSpan()
{
std::vector<IXFContent*>::iterator it;
std::vector<XFContent*>::iterator it;
for( it = m_aContents.begin(); it != m_aContents.end(); ++it )
{
IXFContent *pContent = *it;
XFContent *pContent = *it;
if( pContent )
{
delete pContent;
@@ -94,14 +94,14 @@ enumXFContent XFTextSpan::GetContentType()
return enumXFContentSpan;
}
void XFTextSpan::Add(IXFContent *pContent)
void XFTextSpan::Add(XFContent *pContent)
{
m_aContents.push_back(pContent);
}
void XFTextSpan::Add(const OUString& text)
{
IXFContent *pText = new XFTextContent(text);
XFContent *pText = new XFTextContent(text);
Add(pText);
}
@@ -117,10 +117,10 @@ void XFTextSpan::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute( "text:style-name", GetStyleName() );
pStrm->StartElement( "text:span" );
std::vector<IXFContent*>::iterator it;
std::vector<XFContent*>::iterator it;
for( it= m_aContents.begin(); it!= m_aContents.end(); ++it )
{
IXFContent *pContent = *it;
XFContent *pContent = *it;
if( pContent )
pContent->ToXml(pStrm);
}
@@ -140,20 +140,20 @@ void XFTextSpanStart::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute( "text:style-name", GetStyleName() );
pStrm->StartElement( "text:span" );
std::vector<IXFContent*>::iterator it;
std::vector<XFContent*>::iterator it;
for( it= m_aContents.begin(); it!= m_aContents.end(); ++it )
{
IXFContent *pContent = *it;
XFContent *pContent = *it;
if( pContent )
pContent->ToXml(pStrm);
}
}
void XFTextSpanEnd::ToXml(IXFStream *pStrm)
{
std::vector<IXFContent*>::iterator it;
std::vector<XFContent*>::iterator it;
for( it= m_aContents.begin(); it!= m_aContents.end(); ++it )
{
IXFContent *pContent = *it;
XFContent *pContent = *it;
if( pContent )
pContent->ToXml(pStrm);
}

View File

@@ -74,13 +74,13 @@ public:
virtual ~XFTextSpan();
void Add(IXFContent *pContent);
void Add(XFContent *pContent);
void Add(const OUString& text);
virtual enumXFContent GetContentType() SAL_OVERRIDE;
virtual void ToXml(IXFStream *pStrm) SAL_OVERRIDE;
protected:
std::vector<IXFContent*> m_aContents;
std::vector<XFContent*> m_aContents;
};
class XFTextSpanStart : public XFTextSpan //for adding style of power field