2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 15:18:43 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 15:18:43 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 15:18:43 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 15:18:43 +00:00
|
|
|
* $RCSfile: unoidx.cxx,v $
|
2008-07-07 12:07:37 +00:00
|
|
|
* $Revision: 1.68 $
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 15:18:43 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 15:18:43 +00:00
|
|
|
* 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.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 15:18:43 +00:00
|
|
|
* 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).
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 15:18:43 +00:00
|
|
|
* 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.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 20:57:39 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sw.hxx"
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
|
|
|
#include <com/sun/star/container/XIndexReplace.hpp>
|
|
|
|
#include <com/sun/star/frame/XModel.hpp>
|
2001-11-06 07:37:32 +00:00
|
|
|
#include <com/sun/star/text/ChapterFormat.hpp>
|
|
|
|
#include <com/sun/star/text/ReferenceFieldPart.hpp>
|
|
|
|
#include <com/sun/star/text/BibliographyDataField.hpp>
|
|
|
|
#include <com/sun/star/text/XTextDocument.hpp>
|
2010-01-08 17:13:58 +01:00
|
|
|
|
|
|
|
#include <tools/debug.hxx>
|
|
|
|
#include <vos/mutex.hxx>
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
#include <svx/unolingu.hxx>
|
|
|
|
|
|
|
|
#include <hints.hxx>
|
2001-11-06 07:37:32 +00:00
|
|
|
#include <cmdid.h>
|
|
|
|
#include <swtypes.hxx>
|
2002-01-10 12:40:48 +00:00
|
|
|
#include <shellres.hxx>
|
|
|
|
#include <viewsh.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <doc.hxx>
|
|
|
|
#include <docary.hxx>
|
|
|
|
#include <poolfmt.hxx>
|
|
|
|
#ifndef _POOLFMT_HRC
|
|
|
|
#include <poolfmt.hrc>
|
|
|
|
#endif
|
|
|
|
#include <pagedesc.hxx>
|
2010-01-05 16:37:49 +01:00
|
|
|
#include <fmtcntnt.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <unomap.hxx>
|
2010-01-05 16:37:46 +01:00
|
|
|
#include <unotextrange.hxx>
|
2010-01-05 16:37:45 +01:00
|
|
|
#include <unotextcursor.hxx>
|
2010-01-08 17:13:58 +01:00
|
|
|
#include <unosection.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <doctxm.hxx>
|
|
|
|
#include <txttxmrk.hxx>
|
|
|
|
#include <unocrsr.hxx>
|
2000-10-27 11:59:47 +00:00
|
|
|
#include <unostyle.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <ndtxt.hxx>
|
|
|
|
#include <unoidx.hxx>
|
|
|
|
#include <docsh.hxx>
|
|
|
|
#include <chpfld.hxx>
|
2001-07-20 09:22:01 +00:00
|
|
|
#include <SwStyleNameMapper.hxx>
|
2010-01-08 17:13:59 +01:00
|
|
|
#include <unoevtlstnr.hxx>
|
2000-11-09 09:24:14 +00:00
|
|
|
|
2010-01-05 16:37:44 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
using namespace ::com::sun::star;
|
2008-03-12 11:30:08 +00:00
|
|
|
using ::rtl::OUString;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2010-01-08 17:13:58 +01:00
|
|
|
static OUString
|
2010-01-08 17:13:58 +01:00
|
|
|
lcl_AnyToString(uno::Any const& rVal) throw (lang::IllegalArgumentException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2001-06-27 12:48:31 +00:00
|
|
|
OUString sRet;
|
|
|
|
if(!(rVal >>= sRet))
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2001-06-27 12:48:31 +00:00
|
|
|
return sRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
2010-01-08 17:13:58 +01:00
|
|
|
static sal_Int16
|
|
|
|
lcl_AnyToInt16(uno::Any const& rVal) throw (lang::IllegalArgumentException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-11-12 15:27:16 +00:00
|
|
|
sal_Int16 nRet = 0;
|
2003-04-04 17:12:01 +00:00
|
|
|
if(!(rVal >>= nRet))
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
2010-01-08 17:13:58 +01:00
|
|
|
static sal_Bool
|
|
|
|
lcl_AnyToBool(uno::Any const& rVal) throw (lang::IllegalArgumentException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-11-12 15:27:16 +00:00
|
|
|
sal_Bool bRet = sal_False;
|
2003-04-04 17:12:01 +00:00
|
|
|
if(!(rVal >>= bRet))
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2003-04-04 17:12:01 +00:00
|
|
|
return bRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
|
|
|
static void
|
|
|
|
lcl_AnyToBitMask(uno::Any const& rValue,
|
|
|
|
sal_uInt16 & rBitMask, const sal_uInt16 nBit)
|
|
|
|
throw (lang::IllegalArgumentException)
|
|
|
|
{
|
|
|
|
rBitMask = lcl_AnyToBool(rValue)
|
|
|
|
? (rBitMask | nBit)
|
|
|
|
: (rBitMask & ~nBit);
|
|
|
|
}
|
|
|
|
static void
|
|
|
|
lcl_BitMaskToAny(uno::Any & o_rValue,
|
|
|
|
const sal_uInt16 nBitMask, const sal_uInt16 nBit)
|
|
|
|
{
|
|
|
|
const sal_Bool bRet = 0 != (nBitMask & nBit);
|
|
|
|
o_rValue <<= bRet;
|
|
|
|
}
|
|
|
|
|
2002-01-07 15:16:16 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
2010-01-08 17:13:58 +01:00
|
|
|
static void
|
|
|
|
lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName)
|
2002-01-07 15:16:16 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const sal_uInt16 nUserCount = pDoc->GetTOXTypeCount( TOX_USER );
|
2002-01-07 15:16:16 +00:00
|
|
|
const SwTOXType* pNewType = 0;
|
|
|
|
for(sal_uInt16 nUser = 0; nUser < nUserCount; nUser++)
|
|
|
|
{
|
|
|
|
const SwTOXType* pType = pDoc->GetTOXType( TOX_USER, nUser );
|
|
|
|
if(pType->GetTypeName().Equals((String)rNewName))
|
|
|
|
{
|
|
|
|
pNewType = pType;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!pNewType)
|
|
|
|
{
|
|
|
|
SwTOXType aNewType(TOX_USER, rNewName);
|
|
|
|
pNewType = pDoc->InsertTOXType( aNewType );
|
|
|
|
}
|
|
|
|
//has to be non-const-casted
|
|
|
|
((SwTOXType*)pNewType)->Add(&rTOXBase);
|
|
|
|
}
|
2002-01-10 12:40:48 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
static const char cUserDefined[] = "User-Defined";
|
|
|
|
static const char cUserSuffix[] = " (user)";
|
|
|
|
#define USER_LEN 12
|
|
|
|
#define USER_AND_SUFFIXLEN 19
|
|
|
|
|
|
|
|
void lcl_ConvertTOUNameToProgrammaticName(OUString& rTmp)
|
|
|
|
{
|
|
|
|
ShellResource* pShellRes = ViewShell::GetShellRes();
|
|
|
|
|
|
|
|
if(rTmp.equals(pShellRes->aTOXUserName))
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2002-01-10 12:40:48 +00:00
|
|
|
rTmp = OUString(C2U(cUserDefined));
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
// if the version is not English but the alternative index's name is
|
|
|
|
// "User-Defined" a " (user)" is appended
|
2002-01-10 12:40:48 +00:00
|
|
|
else if(rTmp.equalsAscii(cUserDefined))
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2002-01-10 12:40:48 +00:00
|
|
|
rTmp += C2U(cUserSuffix);
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2002-01-10 12:40:48 +00:00
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
2010-01-08 17:13:58 +01:00
|
|
|
static void
|
|
|
|
lcl_ConvertTOUNameToUserName(OUString& rTmp)
|
2002-01-10 12:40:48 +00:00
|
|
|
{
|
|
|
|
ShellResource* pShellRes = ViewShell::GetShellRes();
|
|
|
|
if(rTmp.equalsAscii(cUserDefined))
|
|
|
|
{
|
|
|
|
rTmp = pShellRes->aTOXUserName;
|
|
|
|
}
|
|
|
|
else if(!pShellRes->aTOXUserName.EqualsAscii(cUserDefined) &&
|
|
|
|
USER_AND_SUFFIXLEN == rTmp.getLength())
|
|
|
|
{
|
|
|
|
//make sure that in non-English versions the " (user)" suffix is removed
|
2010-01-08 17:13:58 +01:00
|
|
|
if (rTmp.matchAsciiL(cUserDefined, sizeof(cUserDefined)) &&
|
|
|
|
rTmp.matchAsciiL(cUserSuffix, sizeof(cUserSuffix), USER_LEN))
|
|
|
|
{
|
2002-01-10 12:40:48 +00:00
|
|
|
rTmp = C2U(cUserDefined);
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2002-01-10 12:40:48 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
/* -----------------13.09.99 16:39-------------------
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
|
|
|
typedef ::cppu::WeakImplHelper2
|
|
|
|
< lang::XServiceInfo
|
|
|
|
, container::XIndexReplace
|
|
|
|
> SwXDocumentIndexStyleAccess_Base;
|
|
|
|
|
|
|
|
class SwXDocumentIndex::StyleAccess_Impl
|
|
|
|
: public SwXDocumentIndexStyleAccess_Base
|
|
|
|
{
|
|
|
|
|
|
|
|
private:
|
|
|
|
/// can be destroyed threadsafely, so no UnoImplPtr here
|
|
|
|
::rtl::Reference<SwXDocumentIndex> m_xParent;
|
|
|
|
|
|
|
|
virtual ~StyleAccess_Impl();
|
|
|
|
|
|
|
|
public:
|
|
|
|
StyleAccess_Impl(SwXDocumentIndex& rParentIdx);
|
|
|
|
|
|
|
|
// XServiceInfo
|
|
|
|
virtual ::rtl::OUString SAL_CALL getImplementationName()
|
|
|
|
throw (uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL
|
|
|
|
supportsService(const ::rtl::OUString& rServiceName)
|
|
|
|
throw (uno::RuntimeException);
|
|
|
|
virtual uno::Sequence< ::rtl::OUString > SAL_CALL
|
|
|
|
getSupportedServiceNames() throw (uno::RuntimeException);
|
|
|
|
|
|
|
|
// XElementAccess
|
|
|
|
virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL hasElements() throw (uno::RuntimeException);
|
|
|
|
|
|
|
|
// XIndexAccess
|
|
|
|
virtual sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException);
|
|
|
|
virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex)
|
|
|
|
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException);
|
|
|
|
|
|
|
|
// XIndexReplace
|
|
|
|
virtual void SAL_CALL
|
|
|
|
replaceByIndex(sal_Int32 Index, const uno::Any& rElement)
|
|
|
|
throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
|
|
|
|
lang::WrappedTargetException, uno::RuntimeException);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/* -----------------13.09.99 16:39-------------------
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
|
|
|
typedef ::cppu::WeakImplHelper2
|
|
|
|
< lang::XServiceInfo
|
|
|
|
, container::XIndexReplace
|
|
|
|
> SwXDocumentIndexTokenAccess_Base;
|
|
|
|
|
|
|
|
class SwXDocumentIndex::TokenAccess_Impl
|
|
|
|
: public SwXDocumentIndexTokenAccess_Base
|
|
|
|
{
|
|
|
|
|
|
|
|
private:
|
|
|
|
/// can be destroyed threadsafely, so no UnoImplPtr here
|
|
|
|
::rtl::Reference<SwXDocumentIndex> m_xParent;
|
|
|
|
|
|
|
|
virtual ~TokenAccess_Impl();
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
TokenAccess_Impl(SwXDocumentIndex& rParentIdx);
|
|
|
|
|
|
|
|
// XServiceInfo
|
|
|
|
virtual ::rtl::OUString SAL_CALL getImplementationName()
|
|
|
|
throw (uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL
|
|
|
|
supportsService(const ::rtl::OUString& rServiceName)
|
|
|
|
throw (uno::RuntimeException);
|
|
|
|
virtual uno::Sequence< ::rtl::OUString > SAL_CALL
|
|
|
|
getSupportedServiceNames() throw (uno::RuntimeException);
|
|
|
|
|
|
|
|
// XElementAccess
|
|
|
|
virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL hasElements() throw (uno::RuntimeException);
|
|
|
|
|
|
|
|
// XIndexAccess
|
|
|
|
virtual sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException);
|
|
|
|
virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex)
|
|
|
|
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException);
|
|
|
|
|
|
|
|
// XIndexReplace
|
|
|
|
virtual void SAL_CALL
|
|
|
|
replaceByIndex(sal_Int32 Index, const uno::Any& rElement)
|
|
|
|
throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
|
|
|
|
lang::WrappedTargetException, uno::RuntimeException);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/******************************************************************
|
|
|
|
* SwXDocumentIndex
|
|
|
|
******************************************************************/
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------20.06.98 11:06-------------------
|
|
|
|
*
|
|
|
|
* --------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
class SwDocIndexDescriptorProperties_Impl
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
private:
|
|
|
|
::std::auto_ptr<SwTOXBase> m_pTOXBase;
|
|
|
|
OUString m_sUserTOXTypeName;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2010-01-08 17:13:58 +01:00
|
|
|
SwDocIndexDescriptorProperties_Impl(SwTOXType const*const pType);
|
2002-01-07 15:16:16 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
SwTOXBase & GetTOXBase() { return *m_pTOXBase; }
|
|
|
|
const OUString& GetTypeName() const { return m_sUserTOXTypeName; }
|
|
|
|
void SetTypeName(const OUString& rSet) { m_sUserTOXTypeName = rSet; }
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
/* -----------------20.06.98 11:41-------------------
|
|
|
|
*
|
|
|
|
* --------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
SwDocIndexDescriptorProperties_Impl::SwDocIndexDescriptorProperties_Impl(
|
|
|
|
SwTOXType const*const pType)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwForm aForm(pType->GetType());
|
2010-01-08 17:13:58 +01:00
|
|
|
m_pTOXBase.reset(new SwTOXBase(pType, aForm,
|
|
|
|
nsSwTOXElement::TOX_MARK, pType->GetTypeName()));
|
2002-11-01 14:27:55 +00:00
|
|
|
if(pType->GetType() == TOX_CONTENT || pType->GetType() == TOX_USER)
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
|
|
|
m_pTOXBase->SetLevel(MAXLEVEL);
|
|
|
|
}
|
|
|
|
m_sUserTOXTypeName = pType->GetTypeName();
|
|
|
|
}
|
|
|
|
|
|
|
|
static sal_uInt16
|
2010-01-08 17:13:59 +01:00
|
|
|
lcl_TypeToPropertyMap_Index(const TOXTypes eType)
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
|
|
|
switch (eType)
|
|
|
|
{
|
|
|
|
case TOX_INDEX: return PROPERTY_MAP_INDEX_IDX;
|
|
|
|
case TOX_CONTENT: return PROPERTY_MAP_INDEX_CNTNT;
|
|
|
|
case TOX_TABLES: return PROPERTY_MAP_INDEX_TABLES;
|
|
|
|
case TOX_ILLUSTRATIONS: return PROPERTY_MAP_INDEX_ILLUSTRATIONS;
|
|
|
|
case TOX_OBJECTS: return PROPERTY_MAP_INDEX_OBJECTS;
|
|
|
|
case TOX_AUTHORITIES: return PROPERTY_MAP_BIBLIOGRAPHY;
|
|
|
|
//case TOX_USER:
|
|
|
|
default:
|
|
|
|
return PROPERTY_MAP_INDEX_USER;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SwXDocumentIndex::Impl
|
|
|
|
: public SwClient
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
SfxItemPropertySet const& m_rPropSet;
|
|
|
|
const TOXTypes m_eTOXType;
|
|
|
|
SwEventListenerContainer m_ListenerContainer;
|
|
|
|
bool m_bIsDescriptor;
|
|
|
|
SwDoc * m_pDoc;
|
|
|
|
::std::auto_ptr<SwDocIndexDescriptorProperties_Impl> m_pProps;
|
|
|
|
uno::WeakReference<container::XIndexReplace> m_wStyleAccess;
|
|
|
|
uno::WeakReference<container::XIndexReplace> m_wTokenAccess;
|
|
|
|
|
|
|
|
Impl( SwXDocumentIndex & rThis,
|
|
|
|
SwDoc & rDoc,
|
|
|
|
const TOXTypes eType,
|
|
|
|
SwTOXBaseSection const*const pBaseSection)
|
|
|
|
: SwClient((pBaseSection) ? pBaseSection->GetFmt() : 0)
|
|
|
|
, m_rPropSet(
|
2010-01-08 17:13:59 +01:00
|
|
|
*aSwMapProvider.GetPropertySet(lcl_TypeToPropertyMap_Index(eType)))
|
2010-01-08 17:13:58 +01:00
|
|
|
, m_eTOXType(eType)
|
|
|
|
, m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis))
|
|
|
|
, m_bIsDescriptor(0 == pBaseSection)
|
|
|
|
, m_pDoc(&rDoc)
|
|
|
|
, m_pProps((m_bIsDescriptor)
|
|
|
|
? new SwDocIndexDescriptorProperties_Impl(rDoc.GetTOXType(eType, 0))
|
|
|
|
: 0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SwSectionFmt * GetSectionFmt() const {
|
|
|
|
return static_cast<SwSectionFmt *>(
|
|
|
|
const_cast<SwModify *>(GetRegisteredIn()));
|
|
|
|
}
|
|
|
|
|
|
|
|
SwTOXBase & GetTOXSectionOrThrow() const
|
|
|
|
{
|
|
|
|
SwSectionFmt *const pSectionFmt(GetSectionFmt());
|
|
|
|
SwTOXBase *const pTOXSection( (m_bIsDescriptor)
|
|
|
|
? &m_pProps->GetTOXBase()
|
|
|
|
: ((pSectionFmt)
|
|
|
|
? static_cast<SwTOXBaseSection*>(pSectionFmt->GetSection())
|
|
|
|
: 0));
|
|
|
|
if (!pTOXSection)
|
|
|
|
{
|
|
|
|
throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM(
|
|
|
|
"SwXDocumentIndex: disposed or invalid")), 0);
|
|
|
|
}
|
|
|
|
return *pTOXSection;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 GetFormMax() const
|
|
|
|
{
|
|
|
|
SwTOXBase & rSection( GetTOXSectionOrThrow() );
|
|
|
|
return (m_bIsDescriptor)
|
|
|
|
? SwForm::GetFormMaxLevel(m_eTOXType)
|
|
|
|
: rSection.GetTOXForm().GetFormMax();
|
|
|
|
}
|
|
|
|
|
|
|
|
// SwClient
|
|
|
|
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/*-- 14.12.98 09:35:07---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
void SwXDocumentIndex::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
|
|
|
|
{
|
|
|
|
ClientModify(this, pOld, pNew);
|
|
|
|
|
|
|
|
if (!GetRegisteredIn())
|
|
|
|
{
|
|
|
|
m_ListenerContainer.Disposing();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-- 14.12.98 09:35:03---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndex::SwXDocumentIndex(
|
|
|
|
SwTOXBaseSection const& rBaseSection, SwDoc & rDoc)
|
|
|
|
: m_pImpl( new SwXDocumentIndex::Impl( *this,
|
|
|
|
rDoc, rBaseSection.SwTOXBase::GetType(), & rBaseSection) )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/* -----------------15.01.99 14:59-------------------
|
|
|
|
*
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
SwXDocumentIndex::SwXDocumentIndex(const TOXTypes eType, SwDoc& rDoc)
|
|
|
|
: m_pImpl( new SwXDocumentIndex::Impl( *this, rDoc, eType, 0) )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-- 14.12.98 09:35:04---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndex::~SwXDocumentIndex()
|
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
|
|
|
uno::Reference<text::XDocumentIndex>
|
|
|
|
SwXDocumentIndex::CreateXDocumentIndex(
|
|
|
|
SwDoc & rDoc, SwTOXBaseSection const& rSection)
|
|
|
|
{
|
|
|
|
// re-use existing SwXDocumentIndex
|
|
|
|
// #i105557#: do not iterate over the registered clients: race condition
|
|
|
|
SwSectionFmt *const pFmt = rSection.GetFmt();
|
|
|
|
uno::Reference<text::XDocumentIndex> xIndex(pFmt->GetXObject(),
|
|
|
|
uno::UNO_QUERY);
|
|
|
|
if (!xIndex.is())
|
|
|
|
{
|
|
|
|
SwXDocumentIndex *const pIndex(new SwXDocumentIndex(rSection, rDoc));
|
|
|
|
xIndex.set(pIndex);
|
|
|
|
pFmt->SetXObject(uno::Reference<uno::XInterface>(xIndex));
|
|
|
|
}
|
|
|
|
return xIndex;
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------------------10.03.00 18:02--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
const uno::Sequence< sal_Int8 > & SwXDocumentIndex::getUnoTunnelId()
|
|
|
|
{
|
|
|
|
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
/* -----------------------------10.03.00 18:04--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
sal_Int64 SAL_CALL
|
|
|
|
SwXDocumentIndex::getSomething(const uno::Sequence< sal_Int8 >& rId)
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
return ::sw::UnoTunnelImpl<SwXDocumentIndex>(rId, this);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------------------06.04.00 15:01--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
OUString SAL_CALL
|
|
|
|
SwXDocumentIndex::getImplementationName() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return C2U("SwXDocumentIndex");
|
|
|
|
}
|
|
|
|
/* -----------------------------06.04.00 15:01--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
sal_Bool SAL_CALL
|
|
|
|
SwXDocumentIndex::supportsService(const OUString& rServiceName)
|
|
|
|
throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
|
|
|
return C2U("com.sun.star.text.BaseIndex") == rServiceName
|
|
|
|
|| ((TOX_INDEX == m_pImpl->m_eTOXType) &&
|
|
|
|
rServiceName.equalsAscii("com.sun.star.text.DocumentIndex"))
|
|
|
|
|| ((TOX_CONTENT == m_pImpl->m_eTOXType) &&
|
|
|
|
rServiceName.equalsAscii("com.sun.star.text.ContentIndex"))
|
|
|
|
|| ((TOX_USER == m_pImpl->m_eTOXType) &&
|
|
|
|
rServiceName.equalsAscii("com.sun.star.text.UserDefinedIndex"))
|
|
|
|
|| ((TOX_ILLUSTRATIONS == m_pImpl->m_eTOXType) &&
|
|
|
|
rServiceName.equalsAscii("com.sun.star.text.IllustrationsIndex"))
|
|
|
|
|| ((TOX_TABLES == m_pImpl->m_eTOXType) &&
|
|
|
|
rServiceName.equalsAscii("com.sun.star.text.TableIndex"))
|
|
|
|
|| ((TOX_OBJECTS == m_pImpl->m_eTOXType) &&
|
|
|
|
rServiceName.equalsAscii("com.sun.star.text.ObjectIndex"))
|
|
|
|
|| ((TOX_AUTHORITIES == m_pImpl->m_eTOXType) &&
|
|
|
|
rServiceName.equalsAscii("com.sun.star.text.Bibliography"));
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
/* -----------------------------06.04.00 15:01--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Sequence< OUString > SAL_CALL
|
|
|
|
SwXDocumentIndex::getSupportedServiceNames() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
2007-06-05 16:33:55 +00:00
|
|
|
uno::Sequence< OUString > aRet(2);
|
2000-09-18 23:08:29 +00:00
|
|
|
OUString* pArray = aRet.getArray();
|
|
|
|
pArray[0] = C2U("com.sun.star.text.BaseIndex");
|
2010-01-08 17:13:58 +01:00
|
|
|
switch (m_pImpl->m_eTOXType)
|
|
|
|
{
|
|
|
|
case TOX_INDEX:
|
|
|
|
pArray[1] = C2U("com.sun.star.text.DocumentIndex");
|
|
|
|
break;
|
|
|
|
case TOX_CONTENT:
|
|
|
|
pArray[1] = C2U("com.sun.star.text.ContentIndex");
|
|
|
|
break;
|
|
|
|
case TOX_TABLES:
|
|
|
|
pArray[1] = C2U("com.sun.star.text.TableIndex");
|
|
|
|
break;
|
|
|
|
case TOX_ILLUSTRATIONS:
|
|
|
|
pArray[1] = C2U("com.sun.star.text.IllustrationsIndex");
|
|
|
|
break;
|
|
|
|
case TOX_OBJECTS:
|
|
|
|
pArray[1] = C2U("com.sun.star.text.ObjectIndex");
|
|
|
|
break;
|
|
|
|
case TOX_AUTHORITIES:
|
|
|
|
pArray[1] = C2U("com.sun.star.text.Bibliography");
|
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
//case TOX_USER:
|
|
|
|
default:
|
|
|
|
pArray[1] = C2U("com.sun.star.text.UserDefinedIndex");
|
|
|
|
}
|
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-- 14.12.98 09:35:05---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
OUString SAL_CALL SwXDocumentIndex::getServiceName()
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
USHORT nObjectType = SW_SERVICE_TYPE_INDEX;
|
2010-01-08 17:13:58 +01:00
|
|
|
switch (m_pImpl->m_eTOXType)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
// case TOX_INDEX: break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case TOX_USER: nObjectType = SW_SERVICE_USER_INDEX;
|
|
|
|
break;
|
|
|
|
case TOX_CONTENT: nObjectType = SW_SERVICE_CONTENT_INDEX;
|
|
|
|
break;
|
|
|
|
case TOX_ILLUSTRATIONS: nObjectType = SW_SERVICE_INDEX_ILLUSTRATIONS;
|
|
|
|
break;
|
|
|
|
case TOX_OBJECTS: nObjectType = SW_SERVICE_INDEX_OBJECTS;
|
|
|
|
break;
|
|
|
|
case TOX_TABLES: nObjectType = SW_SERVICE_INDEX_TABLES;
|
|
|
|
break;
|
|
|
|
case TOX_AUTHORITIES: nObjectType = SW_SERVICE_INDEX_BIBLIOGRAPHY;
|
|
|
|
break;
|
2007-09-27 08:37:21 +00:00
|
|
|
default:
|
2010-01-08 17:13:58 +01:00
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
return SwXServiceProvider::GetProviderName(nObjectType);
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 14.12.98 09:35:05---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL SwXDocumentIndex::update() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:58 +01:00
|
|
|
|
|
|
|
SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt();
|
|
|
|
SwTOXBaseSection *const pTOXBase = (pFmt) ?
|
|
|
|
static_cast<SwTOXBaseSection*>(pFmt->GetSection()) : 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if(!pTOXBase)
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
pTOXBase->Update();
|
|
|
|
// page numbers
|
|
|
|
pTOXBase->UpdatePageNum();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 14.12.98 09:35:05---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Reference< beans::XPropertySetInfo > SAL_CALL
|
|
|
|
SwXDocumentIndex::getPropertySetInfo() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
|
|
|
const uno::Reference< beans::XPropertySetInfo > xRef =
|
|
|
|
m_pImpl->m_rPropSet.getPropertySetInfo();
|
|
|
|
return xRef;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 14.12.98 09:35:05---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::setPropertyValue(
|
|
|
|
const OUString& rPropertyName, const uno::Any& rValue)
|
|
|
|
throw (beans::UnknownPropertyException, beans::PropertyVetoException,
|
|
|
|
lang::IllegalArgumentException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:58 +01:00
|
|
|
|
|
|
|
SfxItemPropertySimpleEntry const*const pEntry =
|
|
|
|
m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName);
|
2009-06-03 11:26:39 +00:00
|
|
|
if (!pEntry)
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
|
|
|
throw beans::UnknownPropertyException(
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: "))
|
|
|
|
+ rPropertyName,
|
|
|
|
static_cast<cppu::OWeakObject *>(this));
|
|
|
|
}
|
|
|
|
if (pEntry->nFlags & beans::PropertyAttribute::READONLY)
|
|
|
|
{
|
|
|
|
throw beans::PropertyVetoException(
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM("Property is read-only: " ))
|
|
|
|
+ rPropertyName,
|
|
|
|
static_cast<cppu::OWeakObject *>(this));
|
|
|
|
}
|
2001-11-28 19:15:03 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
SwSectionFmt *const pSectionFmt(m_pImpl->GetSectionFmt());
|
|
|
|
SwTOXBase & rTOXBase( m_pImpl->GetTOXSectionOrThrow() );
|
|
|
|
|
|
|
|
sal_uInt16 nCreate = rTOXBase.GetCreateType();
|
|
|
|
sal_uInt16 nTOIOptions = 0;
|
|
|
|
sal_uInt16 nOLEOptions = rTOXBase.GetOLEOptions();
|
|
|
|
const TOXTypes eTxBaseType = rTOXBase.GetTOXType()->GetType();
|
|
|
|
if (eTxBaseType == TOX_INDEX)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
nTOIOptions = rTOXBase.GetOptions();
|
|
|
|
}
|
|
|
|
SwForm aForm(rTOXBase.GetTOXForm());
|
|
|
|
sal_Bool bForm = sal_False;
|
|
|
|
switch (pEntry->nWID)
|
|
|
|
{
|
|
|
|
case WID_IDX_TITLE:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
OUString sNewName;
|
|
|
|
if (!(rValue >>= sNewName))
|
2002-01-07 15:16:16 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
throw lang::IllegalArgumentException();
|
2002-01-07 15:16:16 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
rTOXBase.SetTitle(sNewName);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_IDX_NAME:
|
|
|
|
{
|
|
|
|
OUString sNewName;
|
|
|
|
if (!(rValue >>= sNewName))
|
2001-06-06 09:41:26 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
throw lang::IllegalArgumentException();
|
2001-06-06 09:41:26 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
rTOXBase.SetTOXName(sNewName);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_USER_IDX_NAME:
|
|
|
|
{
|
|
|
|
OUString sNewName;
|
|
|
|
if (!(rValue >>= sNewName))
|
2001-06-06 09:41:26 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
throw lang::IllegalArgumentException();
|
2001-06-06 09:41:26 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
lcl_ConvertTOUNameToUserName(sNewName);
|
|
|
|
DBG_ASSERT(TOX_USER == eTxBaseType,
|
|
|
|
"tox type name can only be changed for user indexes");
|
|
|
|
if (pSectionFmt)
|
2001-05-29 11:27:19 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
OUString sTmp = rTOXBase.GetTOXType()->GetTypeName();
|
|
|
|
if (sTmp != sNewName)
|
|
|
|
{
|
|
|
|
lcl_ReAssignTOXType(pSectionFmt->GetDoc(),
|
|
|
|
rTOXBase, sNewName);
|
|
|
|
}
|
2001-05-29 11:27:19 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
else
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
m_pImpl->m_pProps->SetTypeName(sNewName);
|
2003-03-27 14:45:43 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_IDX_LOCALE:
|
|
|
|
{
|
|
|
|
lang::Locale aLocale;
|
|
|
|
if (!(rValue>>= aLocale))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
throw lang::IllegalArgumentException();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
rTOXBase.SetLanguage(SvxLocaleToLanguage(aLocale));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_IDX_SORT_ALGORITHM:
|
|
|
|
{
|
|
|
|
OUString sTmp;
|
|
|
|
if (!(rValue >>= sTmp))
|
2001-08-16 11:33:56 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
throw lang::IllegalArgumentException();
|
2001-08-16 11:33:56 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
rTOXBase.SetSortAlgorithm(sTmp);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_LEVEL:
|
|
|
|
{
|
|
|
|
rTOXBase.SetLevel(lcl_AnyToInt16(rValue));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_MARKS:
|
|
|
|
lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_MARK);
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_OUTLINE:
|
|
|
|
lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_OUTLINELEVEL);
|
|
|
|
break;
|
|
|
|
// case WID_PARAGRAPH_STYLE_NAMES :DBG_ERROR("not implemented")
|
|
|
|
// break;
|
|
|
|
case WID_CREATE_FROM_CHAPTER:
|
|
|
|
rTOXBase.SetFromChapter(lcl_AnyToBool(rValue));
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_LABELS:
|
|
|
|
rTOXBase.SetFromObjectNames(! lcl_AnyToBool(rValue));
|
|
|
|
break;
|
|
|
|
case WID_PROTECTED:
|
|
|
|
{
|
|
|
|
sal_Bool bSet = lcl_AnyToBool(rValue);
|
|
|
|
rTOXBase.SetProtected(bSet);
|
|
|
|
if (pSectionFmt)
|
2001-08-16 11:33:56 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
static_cast<SwTOXBaseSection &>(rTOXBase).SetProtect(bSet);
|
2001-08-16 11:33:56 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_USE_ALPHABETICAL_SEPARATORS:
|
|
|
|
lcl_AnyToBitMask(rValue, nTOIOptions,
|
|
|
|
nsSwTOIOptions::TOI_ALPHA_DELIMITTER);
|
|
|
|
break;
|
|
|
|
case WID_USE_KEY_AS_ENTRY:
|
|
|
|
lcl_AnyToBitMask(rValue, nTOIOptions,
|
|
|
|
nsSwTOIOptions::TOI_KEY_AS_ENTRY);
|
|
|
|
break;
|
|
|
|
case WID_USE_COMBINED_ENTRIES:
|
|
|
|
lcl_AnyToBitMask(rValue, nTOIOptions,
|
|
|
|
nsSwTOIOptions::TOI_SAME_ENTRY);
|
|
|
|
break;
|
|
|
|
case WID_IS_CASE_SENSITIVE:
|
|
|
|
lcl_AnyToBitMask(rValue, nTOIOptions,
|
|
|
|
nsSwTOIOptions::TOI_CASE_SENSITIVE);
|
|
|
|
break;
|
|
|
|
case WID_USE_P_P:
|
|
|
|
lcl_AnyToBitMask(rValue, nTOIOptions, nsSwTOIOptions::TOI_FF);
|
|
|
|
break;
|
|
|
|
case WID_USE_DASH:
|
|
|
|
lcl_AnyToBitMask(rValue, nTOIOptions, nsSwTOIOptions::TOI_DASH);
|
|
|
|
break;
|
|
|
|
case WID_USE_UPPER_CASE:
|
|
|
|
lcl_AnyToBitMask(rValue, nTOIOptions,
|
|
|
|
nsSwTOIOptions::TOI_INITIAL_CAPS);
|
|
|
|
break;
|
|
|
|
case WID_IS_COMMA_SEPARATED:
|
|
|
|
bForm = sal_True;
|
|
|
|
aForm.SetCommaSeparated(lcl_AnyToBool(rValue));
|
|
|
|
break;
|
|
|
|
case WID_LABEL_CATEGORY:
|
|
|
|
{
|
|
|
|
// convert file-format/API/external programmatic english name
|
|
|
|
// to internal UI name before usage
|
|
|
|
String aName( SwStyleNameMapper::GetSpecialExtraUIName(
|
|
|
|
lcl_AnyToString(rValue) ) );
|
|
|
|
rTOXBase.SetSequenceName( aName );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_LABEL_DISPLAY_TYPE:
|
|
|
|
{
|
|
|
|
const sal_Int16 nVal = lcl_AnyToInt16(rValue);
|
|
|
|
sal_uInt16 nSet = CAPTION_COMPLETE;
|
|
|
|
switch (nVal)
|
2001-08-16 11:33:56 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
case text::ReferenceFieldPart::TEXT:
|
|
|
|
nSet = CAPTION_COMPLETE;
|
|
|
|
break;
|
|
|
|
case text::ReferenceFieldPart::CATEGORY_AND_NUMBER:
|
|
|
|
nSet = CAPTION_NUMBER;
|
|
|
|
break;
|
|
|
|
case text::ReferenceFieldPart::ONLY_CAPTION:
|
|
|
|
nSet = CAPTION_TEXT;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
throw lang::IllegalArgumentException();
|
2001-08-16 11:33:56 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
rTOXBase.SetCaptionDisplay(static_cast<SwCaptionDisplay>(nSet));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_USE_LEVEL_FROM_SOURCE:
|
|
|
|
rTOXBase.SetLevelFromChapter(lcl_AnyToBool(rValue));
|
|
|
|
break;
|
|
|
|
case WID_MAIN_ENTRY_CHARACTER_STYLE_NAME:
|
|
|
|
{
|
|
|
|
String aString;
|
|
|
|
SwStyleNameMapper::FillUIName(lcl_AnyToString(rValue),
|
|
|
|
aString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True);
|
|
|
|
rTOXBase.SetMainEntryCharStyle( aString );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_TABLES:
|
|
|
|
lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_TABLE);
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_TEXT_FRAMES:
|
|
|
|
lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_FRAME);
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_GRAPHIC_OBJECTS:
|
|
|
|
lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_GRAPHIC);
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_EMBEDDED_OBJECTS:
|
|
|
|
lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_OLE);
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_STAR_MATH:
|
|
|
|
lcl_AnyToBitMask(rValue, nOLEOptions, nsSwTOOElements::TOO_MATH);
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_STAR_CHART:
|
|
|
|
lcl_AnyToBitMask(rValue, nOLEOptions, nsSwTOOElements::TOO_CHART);
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_STAR_CALC:
|
|
|
|
lcl_AnyToBitMask(rValue, nOLEOptions, nsSwTOOElements::TOO_CALC);
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_STAR_DRAW:
|
|
|
|
lcl_AnyToBitMask(rValue, nOLEOptions,
|
|
|
|
nsSwTOOElements::TOO_DRAW_IMPRESS);
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_OTHER_EMBEDDED_OBJECTS:
|
|
|
|
lcl_AnyToBitMask(rValue, nOLEOptions, nsSwTOOElements::TOO_OTHER);
|
|
|
|
break;
|
|
|
|
case WID_PARA_HEAD:
|
|
|
|
{
|
|
|
|
String aString;
|
|
|
|
SwStyleNameMapper::FillUIName( lcl_AnyToString(rValue),
|
|
|
|
aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True);
|
|
|
|
bForm = sal_True;
|
|
|
|
// Header is on Pos 0
|
|
|
|
aForm.SetTemplate( 0, aString );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_IS_RELATIVE_TABSTOPS:
|
|
|
|
bForm = sal_True;
|
|
|
|
aForm.SetRelTabPos(lcl_AnyToBool(rValue));
|
|
|
|
break;
|
|
|
|
case WID_PARA_SEP:
|
|
|
|
{
|
|
|
|
String aString;
|
|
|
|
bForm = sal_True;
|
|
|
|
SwStyleNameMapper::FillUIName( lcl_AnyToString(rValue),
|
|
|
|
aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True);
|
|
|
|
aForm.SetTemplate( 1, aString );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_PARAGRAPH_STYLES:
|
|
|
|
lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_TEMPLATE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WID_PARA_LEV1:
|
|
|
|
case WID_PARA_LEV2:
|
|
|
|
case WID_PARA_LEV3:
|
|
|
|
case WID_PARA_LEV4:
|
|
|
|
case WID_PARA_LEV5:
|
|
|
|
case WID_PARA_LEV6:
|
|
|
|
case WID_PARA_LEV7:
|
|
|
|
case WID_PARA_LEV8:
|
|
|
|
case WID_PARA_LEV9:
|
|
|
|
case WID_PARA_LEV10:
|
|
|
|
{
|
|
|
|
bForm = sal_True;
|
|
|
|
// in sdbcx::Index Label 1 begins at Pos 2 otherwise at Pos 1
|
|
|
|
const sal_uInt16 nLPos = rTOXBase.GetType() == TOX_INDEX ? 2 : 1;
|
|
|
|
String aString;
|
|
|
|
SwStyleNameMapper::FillUIName( lcl_AnyToString(rValue),
|
|
|
|
aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True);
|
|
|
|
aForm.SetTemplate(nLPos + pEntry->nWID - WID_PARA_LEV1, aString );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
//this is for items only
|
|
|
|
if (WID_PRIMARY_KEY > pEntry->nWID)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const SwAttrSet& rSet =
|
|
|
|
m_pImpl->m_pDoc->GetTOXBaseAttrSet(rTOXBase);
|
|
|
|
SfxItemSet aAttrSet(rSet);
|
|
|
|
m_pImpl->m_rPropSet.setPropertyValue(
|
|
|
|
rPropertyName, rValue, aAttrSet);
|
|
|
|
|
|
|
|
const SwSectionFmts& rSects = m_pImpl->m_pDoc->GetSections();
|
|
|
|
for (sal_uInt16 i = 0; i < rSects.Count(); i++)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const SwSectionFmt* pTmpFmt = rSects[ i ];
|
|
|
|
if (pTmpFmt == pSectionFmt)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
m_pImpl->m_pDoc->ChgSection( i,
|
|
|
|
static_cast<SwTOXBaseSection&>(rTOXBase),
|
|
|
|
& aAttrSet);
|
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
rTOXBase.SetCreate(nCreate);
|
|
|
|
rTOXBase.SetOLEOptions(nOLEOptions);
|
|
|
|
if (rTOXBase.GetTOXType()->GetType() == TOX_INDEX)
|
|
|
|
{
|
|
|
|
rTOXBase.SetOptions(nTOIOptions);
|
|
|
|
}
|
|
|
|
if (bForm)
|
|
|
|
{
|
|
|
|
rTOXBase.SetTOXForm(aForm);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 14.12.98 09:35:05---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Any SAL_CALL
|
|
|
|
SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName)
|
|
|
|
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
uno::Any aRet;
|
2010-01-08 17:13:58 +01:00
|
|
|
SfxItemPropertySimpleEntry const*const pEntry =
|
|
|
|
m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName);
|
2009-06-03 11:26:39 +00:00
|
|
|
if (!pEntry)
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
|
|
|
throw beans::UnknownPropertyException(
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: "))
|
|
|
|
+ rPropertyName,
|
|
|
|
static_cast< cppu::OWeakObject * >(this));
|
|
|
|
}
|
|
|
|
|
|
|
|
SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() );
|
2007-09-27 08:37:21 +00:00
|
|
|
SwTOXBase* pTOXBase = 0;
|
2010-01-08 17:13:58 +01:00
|
|
|
if (pSectionFmt)
|
|
|
|
{
|
|
|
|
pTOXBase = static_cast<SwTOXBaseSection*>(pSectionFmt->GetSection());
|
|
|
|
}
|
|
|
|
else if (m_pImpl->m_bIsDescriptor)
|
|
|
|
{
|
|
|
|
pTOXBase = &m_pImpl->m_pProps->GetTOXBase();
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
if(pTOXBase)
|
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const sal_uInt16 nCreate = pTOXBase->GetCreateType();
|
|
|
|
const sal_uInt16 nOLEOptions = pTOXBase->GetOLEOptions();
|
|
|
|
const sal_uInt16 nTOIOptions =
|
|
|
|
(pTOXBase->GetTOXType()->GetType() == TOX_INDEX)
|
|
|
|
? pTOXBase->GetOptions()
|
|
|
|
: 0U;
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwForm& rForm = pTOXBase->GetTOXForm();
|
2009-06-03 11:26:39 +00:00
|
|
|
switch(pEntry->nWID)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2000-11-29 10:41:48 +00:00
|
|
|
case WID_IDX_CONTENT_SECTION:
|
|
|
|
case WID_IDX_HEADER_SECTION :
|
2009-06-03 11:26:39 +00:00
|
|
|
if(WID_IDX_CONTENT_SECTION == pEntry->nWID)
|
2000-11-29 10:41:48 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const uno::Reference <text::XTextSection> xContentSect =
|
|
|
|
SwXTextSection::CreateXTextSection( pSectionFmt );
|
2000-11-29 10:41:48 +00:00
|
|
|
aRet <<= xContentSect;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwSections aSectArr;
|
2010-01-08 17:13:58 +01:00
|
|
|
pSectionFmt->GetChildSections(aSectArr,
|
|
|
|
SORTSECT_NOT, FALSE);
|
2000-11-29 10:41:48 +00:00
|
|
|
for(USHORT i = 0; i < aSectArr.Count(); i++)
|
|
|
|
{
|
|
|
|
SwSection* pSect = aSectArr[i];
|
|
|
|
if(pSect->GetType() == TOX_HEADER_SECTION)
|
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const uno::Reference <text::XTextSection> xHeader =
|
|
|
|
SwXTextSection::CreateXTextSection(
|
|
|
|
pSect->GetFmt() );
|
|
|
|
aRet <<= xHeader;
|
2000-11-29 10:41:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
case WID_IDX_TITLE :
|
2000-11-07 10:18:00 +00:00
|
|
|
{
|
|
|
|
OUString uRet(pTOXBase->GetTitle());
|
|
|
|
aRet <<= uRet;
|
2001-06-15 09:01:58 +00:00
|
|
|
break;
|
2000-11-07 10:18:00 +00:00
|
|
|
}
|
2001-08-23 08:38:30 +00:00
|
|
|
case WID_IDX_NAME:
|
|
|
|
aRet <<= OUString(pTOXBase->GetTOXName());
|
|
|
|
break;
|
2002-01-07 15:16:16 +00:00
|
|
|
case WID_USER_IDX_NAME:
|
|
|
|
{
|
|
|
|
OUString sTmp;
|
2010-01-08 17:13:58 +01:00
|
|
|
if (!m_pImpl->m_bIsDescriptor)
|
|
|
|
{
|
2002-01-07 15:16:16 +00:00
|
|
|
sTmp = pTOXBase->GetTOXType()->GetTypeName();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2002-01-07 15:16:16 +00:00
|
|
|
else
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
|
|
|
sTmp = m_pImpl->m_pProps->GetTypeName();
|
|
|
|
}
|
2002-01-10 12:40:48 +00:00
|
|
|
//I18N
|
|
|
|
lcl_ConvertTOUNameToProgrammaticName(sTmp);
|
2002-01-07 15:16:16 +00:00
|
|
|
aRet <<= sTmp;
|
|
|
|
}
|
|
|
|
break;
|
2001-06-06 09:41:26 +00:00
|
|
|
case WID_IDX_LOCALE:
|
|
|
|
aRet <<= SvxCreateLocale(pTOXBase->GetLanguage());
|
|
|
|
break;
|
|
|
|
case WID_IDX_SORT_ALGORITHM:
|
|
|
|
aRet <<= OUString(pTOXBase->GetSortAlgorithm());
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
case WID_LEVEL :
|
2010-01-08 17:13:58 +01:00
|
|
|
aRet <<= static_cast<sal_Int16>(pTOXBase->GetLevel());
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_MARKS:
|
|
|
|
lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_MARK);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_OUTLINE:
|
|
|
|
lcl_BitMaskToAny(aRet, nCreate,
|
|
|
|
nsSwTOXElement::TOX_OUTLINELEVEL);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_CHAPTER:
|
|
|
|
{
|
|
|
|
const sal_Bool bRet = pTOXBase->IsFromChapter();
|
|
|
|
aRet <<= bRet;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_LABELS:
|
|
|
|
{
|
|
|
|
const sal_Bool bRet = ! pTOXBase->IsFromObjectNames();
|
|
|
|
aRet <<= bRet;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_PROTECTED:
|
|
|
|
{
|
|
|
|
const sal_Bool bRet = pTOXBase->IsProtected();
|
|
|
|
aRet <<= bRet;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
case WID_USE_ALPHABETICAL_SEPARATORS:
|
2010-01-08 17:13:58 +01:00
|
|
|
lcl_BitMaskToAny(aRet, nTOIOptions,
|
|
|
|
nsSwTOIOptions::TOI_ALPHA_DELIMITTER);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_USE_KEY_AS_ENTRY:
|
|
|
|
lcl_BitMaskToAny(aRet, nTOIOptions,
|
|
|
|
nsSwTOIOptions::TOI_KEY_AS_ENTRY);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_USE_COMBINED_ENTRIES:
|
|
|
|
lcl_BitMaskToAny(aRet, nTOIOptions,
|
|
|
|
nsSwTOIOptions::TOI_SAME_ENTRY);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_IS_CASE_SENSITIVE:
|
|
|
|
lcl_BitMaskToAny(aRet, nTOIOptions,
|
|
|
|
nsSwTOIOptions::TOI_CASE_SENSITIVE);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
case WID_USE_P_P:
|
2010-01-08 17:13:58 +01:00
|
|
|
lcl_BitMaskToAny(aRet, nTOIOptions, nsSwTOIOptions::TOI_FF);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_USE_DASH:
|
|
|
|
lcl_BitMaskToAny(aRet, nTOIOptions, nsSwTOIOptions::TOI_DASH);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_USE_UPPER_CASE:
|
|
|
|
lcl_BitMaskToAny(aRet, nTOIOptions,
|
|
|
|
nsSwTOIOptions::TOI_INITIAL_CAPS);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_IS_COMMA_SEPARATED:
|
|
|
|
{
|
|
|
|
const sal_Bool bRet = rForm.IsCommaSeparated();
|
|
|
|
aRet <<= bRet;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_LABEL_CATEGORY:
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
|
|
|
// convert internal UI name to
|
|
|
|
// file-format/API/external programmatic english name
|
|
|
|
// before usage
|
|
|
|
String aName( SwStyleNameMapper::GetSpecialExtraProgName(
|
|
|
|
pTOXBase->GetSequenceName() ) );
|
|
|
|
aRet <<= OUString( aName );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_LABEL_DISPLAY_TYPE:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2001-01-12 17:30:43 +00:00
|
|
|
sal_Int16 nSet = text::ReferenceFieldPart::TEXT;
|
2000-09-18 23:08:29 +00:00
|
|
|
switch (pTOXBase->GetCaptionDisplay())
|
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
case CAPTION_COMPLETE:
|
|
|
|
nSet = text::ReferenceFieldPart::TEXT;
|
|
|
|
break;
|
|
|
|
case CAPTION_NUMBER:
|
|
|
|
nSet = text::ReferenceFieldPart::CATEGORY_AND_NUMBER;
|
|
|
|
break;
|
|
|
|
case CAPTION_TEXT:
|
|
|
|
nSet = text::ReferenceFieldPart::ONLY_CAPTION;
|
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
aRet <<= nSet;
|
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_USE_LEVEL_FROM_SOURCE:
|
|
|
|
{
|
|
|
|
const sal_Bool bRet = pTOXBase->IsLevelFromChapter();
|
|
|
|
aRet <<= bRet;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_LEVEL_FORMAT:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Reference< container::XIndexReplace > xTokenAccess(
|
|
|
|
m_pImpl->m_wTokenAccess);
|
|
|
|
if (!xTokenAccess.is())
|
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
xTokenAccess = new TokenAccess_Impl(*this);
|
2010-01-08 17:13:58 +01:00
|
|
|
m_pImpl->m_wTokenAccess = xTokenAccess;
|
|
|
|
}
|
|
|
|
aRet <<= xTokenAccess;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_LEVEL_PARAGRAPH_STYLES:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Reference< container::XIndexReplace > xStyleAccess(
|
|
|
|
m_pImpl->m_wStyleAccess);
|
|
|
|
if (!xStyleAccess.is())
|
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
xStyleAccess = new StyleAccess_Impl(*this);
|
2010-01-08 17:13:58 +01:00
|
|
|
m_pImpl->m_wStyleAccess = xStyleAccess;
|
|
|
|
}
|
|
|
|
aRet <<= xStyleAccess;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_MAIN_ENTRY_CHARACTER_STYLE_NAME:
|
2001-08-16 11:33:56 +00:00
|
|
|
{
|
|
|
|
String aString;
|
|
|
|
SwStyleNameMapper::FillProgName(
|
|
|
|
pTOXBase->GetMainEntryCharStyle(),
|
|
|
|
aString,
|
2007-09-27 08:37:21 +00:00
|
|
|
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT,
|
2001-08-16 11:33:56 +00:00
|
|
|
sal_True);
|
|
|
|
aRet <<= OUString( aString );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_TABLES:
|
|
|
|
lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_TABLE);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_TEXT_FRAMES:
|
|
|
|
lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_FRAME);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_GRAPHIC_OBJECTS:
|
|
|
|
lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_GRAPHIC);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_EMBEDDED_OBJECTS:
|
|
|
|
lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_OLE);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_STAR_MATH:
|
2010-01-08 17:13:58 +01:00
|
|
|
lcl_BitMaskToAny(aRet, nOLEOptions, nsSwTOOElements::TOO_MATH);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_STAR_CHART:
|
|
|
|
lcl_BitMaskToAny(aRet, nOLEOptions, nsSwTOOElements::TOO_CHART);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_STAR_CALC:
|
|
|
|
lcl_BitMaskToAny(aRet, nOLEOptions, nsSwTOOElements::TOO_CALC);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_CREATE_FROM_STAR_DRAW:
|
|
|
|
lcl_BitMaskToAny(aRet, nOLEOptions,
|
|
|
|
nsSwTOOElements::TOO_DRAW_IMPRESS);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
case WID_CREATE_FROM_OTHER_EMBEDDED_OBJECTS:
|
2010-01-08 17:13:58 +01:00
|
|
|
lcl_BitMaskToAny(aRet, nOLEOptions, nsSwTOOElements::TOO_OTHER);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2000-11-21 11:00:41 +00:00
|
|
|
case WID_CREATE_FROM_PARAGRAPH_STYLES:
|
2010-01-08 17:13:58 +01:00
|
|
|
lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_TEMPLATE);
|
2000-11-21 11:00:41 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_PARA_HEAD:
|
2001-08-16 11:33:56 +00:00
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
//Header steht an Pos 0
|
2001-08-16 11:33:56 +00:00
|
|
|
String aString;
|
|
|
|
SwStyleNameMapper::FillProgName(rForm.GetTemplate( 0 ), aString,
|
2007-09-27 08:37:21 +00:00
|
|
|
nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True );
|
2001-08-16 11:33:56 +00:00
|
|
|
aRet <<= OUString( aString );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_PARA_SEP:
|
2001-08-16 11:33:56 +00:00
|
|
|
{
|
|
|
|
String aString;
|
|
|
|
SwStyleNameMapper::FillProgName(
|
|
|
|
rForm.GetTemplate( 1 ),
|
|
|
|
aString,
|
2007-09-27 08:37:21 +00:00
|
|
|
nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL,
|
2001-08-16 11:33:56 +00:00
|
|
|
sal_True);
|
|
|
|
aRet <<= OUString( aString );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case WID_PARA_LEV1:
|
|
|
|
case WID_PARA_LEV2:
|
|
|
|
case WID_PARA_LEV3:
|
|
|
|
case WID_PARA_LEV4:
|
|
|
|
case WID_PARA_LEV5:
|
|
|
|
case WID_PARA_LEV6:
|
|
|
|
case WID_PARA_LEV7:
|
|
|
|
case WID_PARA_LEV8:
|
|
|
|
case WID_PARA_LEV9:
|
|
|
|
case WID_PARA_LEV10:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
// in sdbcx::Index Label 1 begins at Pos 2 otherwise at Pos 1
|
2000-09-18 23:08:29 +00:00
|
|
|
sal_uInt16 nLPos = pTOXBase->GetType() == TOX_INDEX ? 2 : 1;
|
2001-08-16 11:33:56 +00:00
|
|
|
String aString;
|
|
|
|
SwStyleNameMapper::FillProgName(
|
2009-06-03 11:26:39 +00:00
|
|
|
rForm.GetTemplate(nLPos + pEntry->nWID - WID_PARA_LEV1),
|
2001-08-16 11:33:56 +00:00
|
|
|
aString,
|
2007-09-27 08:37:21 +00:00
|
|
|
nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL,
|
2001-08-16 11:33:56 +00:00
|
|
|
sal_True);
|
|
|
|
aRet <<= OUString( aString );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2000-11-20 19:28:19 +00:00
|
|
|
case WID_IS_RELATIVE_TABSTOPS:
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
|
|
|
const sal_Bool bRet = rForm.IsRelTabPos();
|
|
|
|
aRet <<= bRet;
|
|
|
|
}
|
2000-11-20 19:28:19 +00:00
|
|
|
break;
|
2000-11-02 14:03:38 +00:00
|
|
|
case WID_INDEX_MARKS:
|
|
|
|
{
|
|
|
|
SwTOXMarks aMarks;
|
2010-01-08 17:13:58 +01:00
|
|
|
SwTOXType const*const pType = pTOXBase->GetTOXType();
|
|
|
|
SwClientIter aIter(*pType);
|
|
|
|
SwTOXMark * pMark =
|
|
|
|
static_cast<SwTOXMark*>(aIter.First(TYPE(SwTOXMark)));
|
2000-11-02 14:03:38 +00:00
|
|
|
while( pMark )
|
|
|
|
{
|
|
|
|
if(pMark->GetTxtTOXMark())
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2000-11-09 14:34:31 +00:00
|
|
|
aMarks.C40_INSERT(SwTOXMark, pMark, aMarks.Count());
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
pMark = static_cast<SwTOXMark*>(aIter.Next());
|
2000-11-02 14:03:38 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Sequence< uno::Reference<text::XDocumentIndexMark> >
|
|
|
|
aXMarks(aMarks.Count());
|
|
|
|
uno::Reference<text::XDocumentIndexMark>* pxMarks =
|
|
|
|
aXMarks.getArray();
|
2000-11-02 14:03:38 +00:00
|
|
|
for(USHORT i = 0; i < aMarks.Count(); i++)
|
|
|
|
{
|
2007-09-27 08:37:21 +00:00
|
|
|
pMark = aMarks.GetObject(i);
|
2010-01-08 17:13:59 +01:00
|
|
|
pxMarks[i] = SwXDocumentIndexMark::CreateXDocumentIndexMark(
|
|
|
|
*m_pImpl->m_pDoc,
|
|
|
|
*const_cast<SwTOXType*>(pType), *pMark);
|
2000-11-02 14:03:38 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
aRet <<= aXMarks;
|
2000-11-02 14:03:38 +00:00
|
|
|
}
|
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
default:
|
|
|
|
//this is for items only
|
2009-06-03 11:26:39 +00:00
|
|
|
if(WID_PRIMARY_KEY > pEntry->nWID)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const SwAttrSet& rSet =
|
|
|
|
m_pImpl->m_pDoc->GetTOXBaseAttrSet(*pTOXBase);
|
|
|
|
aRet = m_pImpl->m_rPropSet.getPropertyValue(
|
|
|
|
rPropertyName, rSet);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-- 14.12.98 09:35:06---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::addPropertyChangeListener(
|
|
|
|
const ::rtl::OUString& /*rPropertyName*/,
|
|
|
|
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
|
|
|
|
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
OSL_ENSURE(false,
|
|
|
|
"SwXDocumentIndex::addPropertyChangeListener(): not implemented");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::removePropertyChangeListener(
|
|
|
|
const ::rtl::OUString& /*rPropertyName*/,
|
|
|
|
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
|
|
|
|
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
OSL_ENSURE(false,
|
|
|
|
"SwXDocumentIndex::removePropertyChangeListener(): not implemented");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::addVetoableChangeListener(
|
|
|
|
const ::rtl::OUString& /*rPropertyName*/,
|
|
|
|
const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
|
|
|
|
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
OSL_ENSURE(false,
|
|
|
|
"SwXDocumentIndex::addVetoableChangeListener(): not implemented");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::removeVetoableChangeListener(
|
|
|
|
const ::rtl::OUString& /*rPropertyName*/,
|
|
|
|
const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
|
|
|
|
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
OSL_ENSURE(false,
|
|
|
|
"SwXDocumentIndex::removeVetoableChangeListener(): not implemented");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------18.02.99 13:39-------------------
|
|
|
|
*
|
|
|
|
* --------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::attach(const uno::Reference< text::XTextRange > & xTextRange)
|
|
|
|
throw (lang::IllegalArgumentException, uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
|
|
|
|
|
|
|
if (!m_pImpl->m_bIsDescriptor)
|
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
const uno::Reference<XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
|
|
|
|
SwXTextRange *const pRange =
|
|
|
|
::sw::UnoTunnelGetImplementation<SwXTextRange>(xRangeTunnel);
|
|
|
|
OTextCursorHelper *const pCursor =
|
|
|
|
::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xRangeTunnel);
|
|
|
|
|
|
|
|
SwDoc *const pDoc =
|
|
|
|
(pRange) ? pRange->GetDoc() : ((pCursor) ? pCursor->GetDoc() : 0);
|
|
|
|
if (!pDoc)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
throw lang::IllegalArgumentException();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
SwUnoInternalPaM aPam(*pDoc);
|
|
|
|
//das muss jetzt sal_True liefern
|
|
|
|
::sw::XTextRangeToSwPaM(aPam, xTextRange);
|
|
|
|
|
|
|
|
const SwTOXBase* pOld = pDoc->GetCurTOX( *aPam.Start() );
|
|
|
|
if (pOld)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
throw lang::IllegalArgumentException();
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
UnoActionContext aAction(pDoc);
|
|
|
|
if (aPam.HasMark())
|
|
|
|
{
|
|
|
|
pDoc->DeleteAndJoin(aPam);
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
SwTOXBase & rTOXBase = m_pImpl->m_pProps->GetTOXBase();
|
|
|
|
SwTOXType const*const pTOXType = rTOXBase.GetTOXType();
|
|
|
|
if ((TOX_USER == pTOXType->GetType()) &&
|
|
|
|
!m_pImpl->m_pProps->GetTypeName().equals(pTOXType->GetTypeName()))
|
|
|
|
{
|
|
|
|
lcl_ReAssignTOXType(pDoc, rTOXBase, m_pImpl->m_pProps->GetTypeName());
|
|
|
|
}
|
|
|
|
//TODO: apply Section attributes (columns and background)
|
|
|
|
SwTOXBaseSection const*const pTOX =
|
|
|
|
pDoc->InsertTableOf( *aPam.GetPoint(), rTOXBase, 0, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
pDoc->SetTOXBaseName(*pTOX, m_pImpl->m_pProps->GetTOXBase().GetTOXName());
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
// update page numbers
|
|
|
|
pTOX->GetFmt()->Add(m_pImpl.get());
|
|
|
|
pTOX->GetFmt()->SetXObject(static_cast< ::cppu::OWeakObject*>(this));
|
|
|
|
const_cast<SwTOXBaseSection*>(pTOX)->UpdatePageNum();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
m_pImpl->m_pProps.reset();
|
|
|
|
m_pImpl->m_pDoc = pDoc;
|
|
|
|
m_pImpl->m_bIsDescriptor = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-- 15.01.99 14:23:56---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Reference< text::XTextRange > SAL_CALL
|
|
|
|
SwXDocumentIndex::getAnchor() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:58 +01:00
|
|
|
|
|
|
|
SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() );
|
|
|
|
if (!pSectionFmt)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< text::XTextRange > xRet;
|
|
|
|
SwNodeIndex const*const pIdx( pSectionFmt->GetCntnt().GetCntntIdx() );
|
|
|
|
if (pIdx && pIdx->GetNode().GetNodes().IsDocNodes())
|
|
|
|
{
|
|
|
|
SwPaM aPaM(*pIdx);
|
|
|
|
aPaM.Move( fnMoveForward, fnGoCntnt );
|
|
|
|
aPaM.SetMark();
|
|
|
|
aPaM.GetPoint()->nNode = *pIdx->GetNode().EndOfSectionNode();
|
|
|
|
aPaM.Move( fnMoveBackward, fnGoCntnt );
|
|
|
|
xRet = SwXTextRange::CreateXTextRange(*pSectionFmt->GetDoc(),
|
|
|
|
*aPaM.GetMark(), aPaM.GetPoint());
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
return xRet;
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 15.01.99 15:46:48---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
void lcl_RemoveChildSections(SwSectionFmt& rParentFmt)
|
|
|
|
{
|
|
|
|
SwSections aTmpArr;
|
2010-01-08 17:13:58 +01:00
|
|
|
SwDoc *const pDoc = rParentFmt.GetDoc();
|
|
|
|
const sal_uInt16 nCnt = rParentFmt.GetChildSections(aTmpArr, SORTSECT_POS);
|
2000-09-18 23:08:29 +00:00
|
|
|
if( nCnt )
|
|
|
|
{
|
|
|
|
for( sal_uInt16 n = 0; n < nCnt; ++n )
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
if( aTmpArr[n]->GetFmt()->IsInNodesArr() )
|
|
|
|
{
|
|
|
|
SwSectionFmt* pFmt = aTmpArr[n]->GetFmt();
|
|
|
|
lcl_RemoveChildSections(*pFmt);
|
|
|
|
pDoc->DelSectionFmt( pFmt );
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
|
|
|
void SAL_CALL SwXDocumentIndex::dispose() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:58 +01:00
|
|
|
|
|
|
|
SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() );
|
|
|
|
if (pSectionFmt)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
pSectionFmt->GetDoc()->DeleteTOX(
|
|
|
|
*static_cast<SwTOXBaseSection*>(pSectionFmt->GetSection()),
|
|
|
|
sal_True);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 15.01.99 15:46:49---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::addEventListener(
|
|
|
|
const uno::Reference< lang::XEventListener > & xListener)
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
|
|
|
if (!m_pImpl->GetRegisteredIn())
|
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
m_pImpl->m_ListenerContainer.AddListener(xListener);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
/*-- 15.01.99 15:46:54---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::removeEventListener(
|
|
|
|
const uno::Reference< lang::XEventListener > & xListener)
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
|
|
|
if (!m_pImpl->GetRegisteredIn() ||
|
|
|
|
!m_pImpl->m_ListenerContainer.RemoveListener(xListener))
|
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------30.07.99 11:28-------------------
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
OUString SAL_CALL SwXDocumentIndex::getName() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
OUString uRet;
|
2010-01-08 17:13:58 +01:00
|
|
|
SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() );
|
|
|
|
if (m_pImpl->m_bIsDescriptor)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
uRet = OUString(m_pImpl->m_pProps->GetTOXBase().GetTOXName());
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else if(pSectionFmt)
|
|
|
|
{
|
|
|
|
uRet = OUString(pSectionFmt->GetSection()->GetName());
|
|
|
|
}
|
|
|
|
else
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
return uRet;
|
|
|
|
}
|
|
|
|
/* -----------------30.07.99 11:28-------------------
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::setName(const OUString& rName) throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
|
|
|
if (!rName.getLength())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
throw uno::RuntimeException();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() );
|
|
|
|
if (m_pImpl->m_bIsDescriptor)
|
|
|
|
{
|
|
|
|
m_pImpl->m_pProps->GetTOXBase().SetTOXName(rName);
|
|
|
|
}
|
|
|
|
else if (pSectionFmt)
|
|
|
|
{
|
|
|
|
const bool bSuccess = pSectionFmt->GetDoc()->SetTOXBaseName(
|
|
|
|
*static_cast<SwTOXBaseSection*>(pSectionFmt->GetSection()), rName);
|
|
|
|
if (!bSuccess)
|
|
|
|
{
|
|
|
|
throw uno::RuntimeException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* SwXDocumentIndexMark
|
|
|
|
******************************************************************/
|
2010-01-08 17:13:59 +01:00
|
|
|
/* -----------------21.04.99 09:36-------------------
|
|
|
|
*
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
static sal_uInt16
|
|
|
|
lcl_TypeToPropertyMap_Mark(const TOXTypes eType)
|
|
|
|
{
|
|
|
|
switch (eType)
|
|
|
|
{
|
|
|
|
case TOX_INDEX: return PROPERTY_MAP_INDEX_MARK;
|
|
|
|
case TOX_CONTENT: return PROPERTY_MAP_CNTIDX_MARK;
|
|
|
|
//case TOX_USER:
|
|
|
|
default:
|
|
|
|
return PROPERTY_MAP_USER_MARK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SwXDocumentIndexMark::Impl
|
|
|
|
: public SwClient
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
SfxItemPropertySet const& m_rPropSet;
|
|
|
|
const TOXTypes m_eTOXType;
|
|
|
|
SwEventListenerContainer m_ListenerContainer;
|
|
|
|
bool m_bIsDescriptor;
|
|
|
|
SwDepend m_TypeDepend;
|
|
|
|
const SwTOXMark * m_pTOXMark;
|
|
|
|
SwDoc * m_pDoc;
|
|
|
|
|
|
|
|
sal_Bool m_bMainEntry;
|
|
|
|
sal_uInt16 m_nLevel;
|
|
|
|
OUString m_sAltText;
|
|
|
|
OUString m_sPrimaryKey;
|
|
|
|
OUString m_sSecondaryKey;
|
|
|
|
OUString m_sTextReading;
|
|
|
|
OUString m_sPrimaryKeyReading;
|
|
|
|
OUString m_sSecondaryKeyReading;
|
|
|
|
OUString m_sUserIndexName;
|
|
|
|
|
|
|
|
Impl( SwXDocumentIndexMark & rThis,
|
|
|
|
SwDoc *const pDoc,
|
|
|
|
const enum TOXTypes eType,
|
|
|
|
SwTOXType *const pType, SwTOXMark const*const pMark)
|
2010-01-08 17:14:00 +01:00
|
|
|
: SwClient(const_cast<SwTOXMark*>(pMark))
|
2010-01-08 17:13:59 +01:00
|
|
|
, m_rPropSet(
|
|
|
|
*aSwMapProvider.GetPropertySet(lcl_TypeToPropertyMap_Mark(eType)))
|
|
|
|
, m_eTOXType(eType)
|
|
|
|
, m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis))
|
|
|
|
, m_bIsDescriptor(0 == pMark)
|
|
|
|
, m_TypeDepend(this, pType)
|
|
|
|
, m_pTOXMark(pMark)
|
|
|
|
, m_pDoc(pDoc)
|
|
|
|
, m_bMainEntry(sal_False)
|
|
|
|
, m_nLevel(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SwTOXType * GetTOXType() const {
|
|
|
|
return static_cast<SwTOXType*>(
|
|
|
|
const_cast<SwModify *>(m_TypeDepend.GetRegisteredIn()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Invalidate();
|
|
|
|
|
|
|
|
// SwClient
|
|
|
|
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/* -----------------------------16.10.00 11:24--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
void SwXDocumentIndexMark::Impl::Invalidate()
|
|
|
|
{
|
|
|
|
if (GetRegisteredIn())
|
|
|
|
{
|
|
|
|
const_cast<SwModify*>(GetRegisteredIn())->Remove(this);
|
|
|
|
if (m_TypeDepend.GetRegisteredIn())
|
|
|
|
{
|
|
|
|
const_cast<SwModify*>(m_TypeDepend.GetRegisteredIn())->Remove(
|
|
|
|
&m_TypeDepend);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_ListenerContainer.Disposing();
|
|
|
|
m_pDoc = 0;
|
|
|
|
m_pTOXMark = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-- 14.12.98 10:25:47---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
void SwXDocumentIndexMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
|
|
|
|
{
|
|
|
|
ClientModify(this, pOld, pNew);
|
|
|
|
|
|
|
|
if (!GetRegisteredIn()) // removed => dispose
|
|
|
|
{
|
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-- 14.12.98 10:25:43---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndexMark::SwXDocumentIndexMark(const TOXTypes eToxType)
|
|
|
|
: m_pImpl( new SwXDocumentIndexMark::Impl(*this, 0, eToxType, 0, 0) )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/*-- 14.12.98 10:25:44---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndexMark::SwXDocumentIndexMark(SwDoc & rDoc,
|
2010-01-08 17:14:00 +01:00
|
|
|
SwTOXType & rType, SwTOXMark & rMark)
|
2010-01-08 17:13:59 +01:00
|
|
|
: m_pImpl( new SwXDocumentIndexMark::Impl(*this, &rDoc, rType.GetType(),
|
|
|
|
&rType, &rMark) )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/*-- 14.12.98 10:25:44---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndexMark::~SwXDocumentIndexMark()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference<text::XDocumentIndexMark>
|
|
|
|
SwXDocumentIndexMark::CreateXDocumentIndexMark(
|
2010-01-08 17:14:00 +01:00
|
|
|
SwDoc & rDoc, SwTOXType & rType, SwTOXMark & rMark)
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
2010-01-08 17:14:00 +01:00
|
|
|
// re-use existing SwXDocumentIndexMark
|
|
|
|
// NB: xmloff depends on this caching to generate ID from the address!
|
2010-01-08 17:13:59 +01:00
|
|
|
// #i105557#: do not iterate over the registered clients: race condition
|
2010-01-08 17:14:00 +01:00
|
|
|
uno::Reference< text::XDocumentIndexMark > xTOXMark(rMark.GetXTOXMark());
|
|
|
|
if (!xTOXMark.is())
|
|
|
|
{
|
|
|
|
SwXDocumentIndexMark *const pNew =
|
|
|
|
new SwXDocumentIndexMark(rDoc, rType, rMark);
|
|
|
|
xTOXMark.set(pNew);
|
|
|
|
rMark.SetXTOXMark(xTOXMark);
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2010-01-08 17:14:00 +01:00
|
|
|
return xTOXMark;
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------------------10.03.00 18:02--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
const uno::Sequence< sal_Int8 > & SwXDocumentIndexMark::getUnoTunnelId()
|
|
|
|
{
|
|
|
|
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
/* -----------------------------10.03.00 18:04--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
sal_Int64 SAL_CALL
|
|
|
|
SwXDocumentIndexMark::getSomething(const uno::Sequence< sal_Int8 >& rId)
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
return ::sw::UnoTunnelImpl<SwXDocumentIndexMark>(rId, this);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
static const sal_Char cBaseMark[] = "com.sun.star.text.BaseIndexMark";
|
|
|
|
static const sal_Char cContentMark[] = "com.sun.star.text.ContentIndexMark";
|
|
|
|
static const sal_Char cIdxMark[] = "com.sun.star.text.DocumentIndexMark";
|
|
|
|
static const sal_Char cIdxMarkAsian[] = "com.sun.star.text.DocumentIndexMarkAsian";
|
|
|
|
static const sal_Char cUserMark[] = "com.sun.star.text.UserIndexMark";
|
|
|
|
static const sal_Char cTextContent[] = "com.sun.star.text.TextContent";
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------------------06.04.00 15:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
OUString SAL_CALL
|
|
|
|
SwXDocumentIndexMark::getImplementationName() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return C2U("SwXDocumentIndexMark");
|
|
|
|
}
|
|
|
|
/* -----------------------------06.04.00 15:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
sal_Bool SAL_CALL
|
|
|
|
SwXDocumentIndexMark::supportsService(const OUString& rServiceName)
|
|
|
|
throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
|
|
|
return rServiceName.equalsAscii(cBaseMark)
|
|
|
|
|| rServiceName.equalsAscii(cTextContent)
|
|
|
|
|| ((m_pImpl->m_eTOXType == TOX_USER)
|
|
|
|
&& rServiceName.equalsAscii(cUserMark))
|
|
|
|
|| ((m_pImpl->m_eTOXType == TOX_CONTENT)
|
|
|
|
&& rServiceName.equalsAscii(cContentMark))
|
|
|
|
|| ((m_pImpl->m_eTOXType == TOX_INDEX)
|
|
|
|
&& rServiceName.equalsAscii(cIdxMark))
|
|
|
|
|| ((m_pImpl->m_eTOXType == TOX_INDEX)
|
|
|
|
&& rServiceName.equalsAscii(cIdxMarkAsian));
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
/* -----------------------------06.04.00 15:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
uno::Sequence< OUString > SAL_CALL
|
|
|
|
SwXDocumentIndexMark::getSupportedServiceNames() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
|
|
|
const sal_Int32 nCnt = (m_pImpl->m_eTOXType == TOX_INDEX) ? 4 : 3;
|
2007-06-05 16:33:55 +00:00
|
|
|
uno::Sequence< OUString > aRet(nCnt);
|
2000-09-18 23:08:29 +00:00
|
|
|
OUString* pArray = aRet.getArray();
|
2000-12-09 13:12:18 +00:00
|
|
|
pArray[0] = C2U(cBaseMark);
|
|
|
|
pArray[1] = C2U(cTextContent);
|
2010-01-08 17:13:59 +01:00
|
|
|
switch (m_pImpl->m_eTOXType)
|
2000-12-09 13:12:18 +00:00
|
|
|
{
|
2002-06-24 10:24:22 +00:00
|
|
|
case TOX_USER:
|
|
|
|
pArray[2] = C2U(cUserMark);
|
|
|
|
break;
|
|
|
|
case TOX_CONTENT:
|
|
|
|
pArray[2] = C2U(cContentMark);
|
|
|
|
break;
|
|
|
|
case TOX_INDEX:
|
|
|
|
pArray[2] = C2U(cIdxMark);
|
|
|
|
pArray[3] = C2U(cIdxMarkAsian);
|
|
|
|
break;
|
2007-09-27 08:37:21 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
;
|
2000-12-09 13:12:18 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
return aRet;
|
|
|
|
}
|
2007-09-27 08:37:21 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 14.12.98 10:25:45---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
OUString SAL_CALL
|
|
|
|
SwXDocumentIndexMark::getMarkEntry() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
OUString sRet;
|
2010-01-08 17:13:59 +01:00
|
|
|
SwTOXType *const pType = m_pImpl->GetTOXType();
|
|
|
|
if (pType && m_pImpl->m_pTOXMark)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
sRet = OUString(m_pImpl->m_pTOXMark->GetAlternativeText());
|
|
|
|
}
|
|
|
|
else if (m_pImpl->m_bIsDescriptor)
|
|
|
|
{
|
|
|
|
sRet = m_pImpl->m_sAltText;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
return sRet;
|
|
|
|
}
|
|
|
|
/*-- 14.12.98 10:25:45---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndexMark::setMarkEntry(const OUString& rIndexEntry)
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
|
|
|
SwTOXType *const pType = m_pImpl->GetTOXType();
|
|
|
|
if (pType && m_pImpl->m_pTOXMark)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
SwTOXMark aMark(*m_pImpl->m_pTOXMark);
|
2000-09-18 23:08:29 +00:00
|
|
|
aMark.SetAlternativeText(rIndexEntry);
|
2010-01-08 17:13:59 +01:00
|
|
|
SwTxtTOXMark const*const pTxtMark =
|
|
|
|
m_pImpl->m_pTOXMark->GetTxtTOXMark();
|
2000-09-18 23:08:29 +00:00
|
|
|
SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart());
|
|
|
|
aPam.SetMark();
|
|
|
|
if(pTxtMark->GetEnd())
|
|
|
|
{
|
|
|
|
aPam.GetPoint()->nContent = *pTxtMark->GetEnd();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
aPam.GetPoint()->nContent++;
|
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
// delete old mark
|
|
|
|
m_pImpl->m_pDoc->DeleteTOXMark(m_pImpl->m_pTOXMark);
|
|
|
|
m_pImpl->m_pTOXMark = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2002-02-05 13:57:52 +00:00
|
|
|
SwTxtAttr* pTxtAttr = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
sal_Bool bInsAtPos = aMark.IsAlternativeText();
|
|
|
|
const SwPosition *pStt = aPam.Start(),
|
|
|
|
*pEnd = aPam.End();
|
|
|
|
if( bInsAtPos )
|
|
|
|
{
|
|
|
|
SwPaM aTmp( *pStt );
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_pDoc->InsertPoolItem( aTmp, aMark, 0 );
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttrForCharAt(
|
2002-02-05 13:57:52 +00:00
|
|
|
pStt->nContent.GetIndex()-1, RES_TXTATR_TOXMARK);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else if( *pEnd != *pStt )
|
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_pDoc->InsertPoolItem( aPam, aMark,
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
nsSetAttrMode::SETATTR_DONTEXPAND );
|
2002-02-05 13:57:52 +00:00
|
|
|
pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttr(
|
|
|
|
pStt->nContent, RES_TXTATR_TOXMARK);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2002-02-05 13:57:52 +00:00
|
|
|
if(pTxtAttr)
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
|
|
|
m_pImpl->m_pTOXMark = &pTxtAttr->GetTOXMark();
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
else if (m_pImpl->m_bIsDescriptor)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_sAltText = rIndexEntry;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------18.02.99 13:40-------------------
|
|
|
|
*
|
|
|
|
* --------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndexMark::attach(
|
|
|
|
const uno::Reference< text::XTextRange > & xTextRange)
|
|
|
|
throw (lang::IllegalArgumentException, uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
if (!m_pImpl->m_bIsDescriptor)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
throw uno::RuntimeException();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
const uno::Reference<XUnoTunnel> xRangeTunnel(xTextRange, uno::UNO_QUERY);
|
|
|
|
SwXTextRange *const pRange =
|
|
|
|
::sw::UnoTunnelGetImplementation<SwXTextRange>(xRangeTunnel);
|
|
|
|
OTextCursorHelper *const pCursor =
|
|
|
|
::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xRangeTunnel);
|
|
|
|
SwDoc *const pDoc =
|
|
|
|
(pRange) ? pRange->GetDoc() : ((pCursor) ? pCursor->GetDoc() : 0);
|
|
|
|
if (!pDoc)
|
|
|
|
{
|
|
|
|
throw lang::IllegalArgumentException();
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
const SwTOXType* pTOXType = 0;
|
|
|
|
switch (m_pImpl->m_eTOXType)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
case TOX_INDEX:
|
|
|
|
case TOX_CONTENT:
|
|
|
|
pTOXType = pDoc->GetTOXType( m_pImpl->m_eTOXType, 0 );
|
|
|
|
break;
|
|
|
|
case TOX_USER:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
if (!m_pImpl->m_sUserIndexName.getLength())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
pTOXType = pDoc->GetTOXType( m_pImpl->m_eTOXType, 0 );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const sal_uInt16 nCount =
|
|
|
|
pDoc->GetTOXTypeCount(m_pImpl->m_eTOXType);
|
|
|
|
for (sal_uInt16 i = 0; i < nCount; i++)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
SwTOXType const*const pTemp =
|
|
|
|
pDoc->GetTOXType( m_pImpl->m_eTOXType, i );
|
|
|
|
if (m_pImpl->m_sUserIndexName ==
|
|
|
|
OUString(pTemp->GetTypeName()))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
pTOXType = pTemp;
|
|
|
|
break;
|
2001-03-20 09:56:03 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
if (!pTOXType)
|
|
|
|
{
|
|
|
|
SwTOXType aUserType(TOX_USER, m_pImpl->m_sUserIndexName);
|
|
|
|
pTOXType = pDoc->InsertTOXType(aUserType);
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
break;
|
2007-09-27 08:37:21 +00:00
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!pTOXType)
|
|
|
|
{
|
|
|
|
throw lang::IllegalArgumentException();
|
|
|
|
}
|
2002-02-05 13:57:52 +00:00
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
SwUnoInternalPaM aPam(*pDoc);
|
|
|
|
//das muss jetzt sal_True liefern
|
|
|
|
::sw::XTextRangeToSwPaM(aPam, xTextRange);
|
|
|
|
SwTOXMark aMark (pTOXType);
|
|
|
|
if (m_pImpl->m_sAltText.getLength())
|
|
|
|
{
|
|
|
|
aMark.SetAlternativeText(m_pImpl->m_sAltText);
|
|
|
|
}
|
|
|
|
switch (m_pImpl->m_eTOXType)
|
|
|
|
{
|
|
|
|
case TOX_INDEX:
|
|
|
|
if (m_pImpl->m_sPrimaryKey.getLength())
|
|
|
|
{
|
|
|
|
aMark.SetPrimaryKey(m_pImpl->m_sPrimaryKey);
|
|
|
|
}
|
|
|
|
if (m_pImpl->m_sSecondaryKey.getLength())
|
|
|
|
{
|
|
|
|
aMark.SetSecondaryKey(m_pImpl->m_sSecondaryKey);
|
|
|
|
}
|
|
|
|
if (m_pImpl->m_sTextReading.getLength())
|
|
|
|
{
|
|
|
|
aMark.SetTextReading(m_pImpl->m_sTextReading);
|
|
|
|
}
|
|
|
|
if (m_pImpl->m_sPrimaryKeyReading.getLength())
|
|
|
|
{
|
|
|
|
aMark.SetPrimaryKeyReading(m_pImpl->m_sPrimaryKeyReading);
|
|
|
|
}
|
|
|
|
if (m_pImpl->m_sSecondaryKeyReading.getLength())
|
|
|
|
{
|
|
|
|
aMark.SetSecondaryKeyReading(m_pImpl->m_sSecondaryKeyReading);
|
|
|
|
}
|
|
|
|
aMark.SetMainEntry(m_pImpl->m_bMainEntry);
|
|
|
|
break;
|
|
|
|
case TOX_USER:
|
|
|
|
case TOX_CONTENT:
|
|
|
|
if (USHRT_MAX != m_pImpl->m_nLevel)
|
|
|
|
{
|
|
|
|
aMark.SetLevel(m_pImpl->m_nLevel+1);
|
|
|
|
}
|
|
|
|
break;
|
2002-02-05 13:57:52 +00:00
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
UnoActionContext aAction(pDoc);
|
|
|
|
const sal_Bool bMark = *aPam.GetPoint() != *aPam.GetMark();
|
|
|
|
// Marks ohne Alternativtext ohne selektierten Text koennen nicht eingefuegt werden,
|
|
|
|
// deshalb hier ein Leerzeichen - ob das die ideale Loesung ist?
|
|
|
|
if (!bMark && !aMark.GetAlternativeText().Len())
|
|
|
|
{
|
|
|
|
aMark.SetAlternativeText( String(' ') );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
SwXTextCursor const*const pTextCursor(
|
|
|
|
dynamic_cast<SwXTextCursor*>(pCursor));
|
|
|
|
const bool bForceExpandHints( (!bMark && pTextCursor)
|
|
|
|
? pTextCursor->IsAtEndOfMeta() : false );
|
|
|
|
const SetAttrMode nInsertFlags = (bForceExpandHints)
|
|
|
|
? ( nsSetAttrMode::SETATTR_FORCEHINTEXPAND
|
|
|
|
| nsSetAttrMode::SETATTR_DONTEXPAND)
|
|
|
|
: nsSetAttrMode::SETATTR_DONTEXPAND;
|
|
|
|
|
|
|
|
pDoc->InsertPoolItem(aPam, aMark, nInsertFlags);
|
|
|
|
if (bMark && *aPam.GetPoint() > *aPam.GetMark())
|
|
|
|
{
|
|
|
|
aPam.Exchange();
|
|
|
|
}
|
|
|
|
|
|
|
|
SwTxtAttr* pTxtAttr = 0;
|
|
|
|
if (bMark)
|
|
|
|
{
|
|
|
|
pTxtAttr = aPam.GetNode()->GetTxtNode()->GetTxtAttr(
|
|
|
|
aPam.GetPoint()->nContent, RES_TXTATR_TOXMARK );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pTxtAttr = aPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
|
|
|
|
aPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_TOXMARK );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!pTxtAttr)
|
|
|
|
{
|
|
|
|
throw uno::RuntimeException();
|
|
|
|
}
|
|
|
|
|
|
|
|
m_pImpl->m_pTOXMark = &pTxtAttr->GetTOXMark();
|
|
|
|
m_pImpl->m_pDoc = pDoc;
|
|
|
|
m_pImpl->m_bIsDescriptor = sal_False;
|
2010-01-08 17:14:00 +01:00
|
|
|
|
|
|
|
const_cast<SwTOXMark*>(m_pImpl->m_pTOXMark)->Add(m_pImpl.get());
|
|
|
|
const_cast<SwTOXType*>(pTOXType)->Add(&m_pImpl->m_TypeDepend);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 14.12.98 10:25:45---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
uno::Reference< text::XTextRange > SAL_CALL
|
|
|
|
SwXDocumentIndexMark::getAnchor() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
|
|
|
SwTOXType *const pType = m_pImpl->GetTOXType();
|
|
|
|
if (!pType || !m_pImpl->m_pTOXMark)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
throw uno::RuntimeException();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
if (!m_pImpl->m_pTOXMark->GetTxtTOXMark())
|
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
|
|
|
const SwTxtTOXMark* pTxtMark = m_pImpl->m_pTOXMark->GetTxtTOXMark();
|
|
|
|
SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart());
|
|
|
|
aPam.SetMark();
|
|
|
|
if(pTxtMark->GetEnd())
|
|
|
|
{
|
|
|
|
aPam.GetPoint()->nContent = *pTxtMark->GetEnd();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aPam.GetPoint()->nContent++;
|
|
|
|
}
|
|
|
|
const uno::Reference< frame::XModel > xModel =
|
|
|
|
m_pImpl->m_pDoc->GetDocShell()->GetBaseModel();
|
|
|
|
const uno::Reference< text::XTextDocument > xTDoc(xModel, uno::UNO_QUERY);
|
|
|
|
const uno::Reference< text::XTextRange > xRet =
|
|
|
|
new SwXTextRange(aPam, xTDoc->getText());
|
|
|
|
|
|
|
|
return xRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 14.12.98 10:25:45---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndexMark::dispose() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
|
|
|
SwTOXType *const pType = m_pImpl->GetTOXType();
|
|
|
|
if (pType && m_pImpl->m_pTOXMark)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_pDoc->DeleteTOXMark(m_pImpl->m_pTOXMark);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/*-- 14.12.98 10:25:45---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndexMark::addEventListener(
|
|
|
|
const uno::Reference< lang::XEventListener > & xListener)
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
|
|
|
if (!m_pImpl->GetRegisteredIn())
|
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
|
|
|
m_pImpl->m_ListenerContainer.AddListener(xListener);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
/*-- 14.12.98 10:25:46---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndexMark::removeEventListener(
|
|
|
|
const uno::Reference< lang::XEventListener > & xListener)
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
|
|
|
if (!m_pImpl->GetRegisteredIn() ||
|
|
|
|
!m_pImpl->m_ListenerContainer.RemoveListener(xListener))
|
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 14.12.98 10:25:46---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
uno::Reference< beans::XPropertySetInfo > SAL_CALL
|
|
|
|
SwXDocumentIndexMark::getPropertySetInfo() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
vos::OGuard g(Application::GetSolarMutex());
|
|
|
|
|
2001-05-09 11:28:57 +00:00
|
|
|
static uno::Reference< beans::XPropertySetInfo > xInfos[3];
|
|
|
|
int nPos = 0;
|
2010-01-08 17:13:59 +01:00
|
|
|
switch (m_pImpl->m_eTOXType)
|
2001-05-09 11:28:57 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
case TOX_INDEX: nPos = 0; break;
|
|
|
|
case TOX_CONTENT: nPos = 1; break;
|
|
|
|
case TOX_USER: nPos = 2; break;
|
2007-09-27 08:37:21 +00:00
|
|
|
default:
|
|
|
|
;
|
2001-05-09 11:28:57 +00:00
|
|
|
}
|
|
|
|
if(!xInfos[nPos].is())
|
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
const uno::Reference< beans::XPropertySetInfo > xInfo =
|
|
|
|
m_pImpl->m_rPropSet.getPropertySetInfo();
|
2001-05-09 11:28:57 +00:00
|
|
|
// extend PropertySetInfo!
|
2001-05-16 06:52:43 +00:00
|
|
|
const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
|
2001-05-09 11:28:57 +00:00
|
|
|
xInfos[nPos] = new SfxExtItemPropertySetInfo(
|
2010-01-08 17:13:59 +01:00
|
|
|
aSwMapProvider.GetPropertyMapEntries(
|
|
|
|
PROPERTY_MAP_PARAGRAPH_EXTENSIONS),
|
2001-05-09 11:28:57 +00:00
|
|
|
aPropSeq );
|
|
|
|
}
|
|
|
|
return xInfos[nPos];
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 14.12.98 10:25:46---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndexMark::setPropertyValue(
|
|
|
|
const OUString& rPropertyName, const uno::Any& rValue)
|
|
|
|
throw (beans::UnknownPropertyException, beans::PropertyVetoException,
|
|
|
|
lang::IllegalArgumentException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
|
|
|
SfxItemPropertySimpleEntry const*const pEntry =
|
|
|
|
m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName);
|
2009-06-03 11:26:39 +00:00
|
|
|
if (!pEntry)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
throw beans::UnknownPropertyException(
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: "))
|
|
|
|
+ rPropertyName,
|
|
|
|
static_cast<cppu::OWeakObject *>(this));
|
|
|
|
}
|
|
|
|
if (pEntry->nFlags & beans::PropertyAttribute::READONLY)
|
|
|
|
{
|
|
|
|
throw beans::PropertyVetoException(
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM("Property is read-only: "))
|
|
|
|
+ rPropertyName,
|
|
|
|
static_cast<cppu::OWeakObject *>(this));
|
|
|
|
}
|
|
|
|
|
|
|
|
SwTOXType *const pType = m_pImpl->GetTOXType();
|
|
|
|
if (pType && m_pImpl->m_pTOXMark)
|
|
|
|
{
|
|
|
|
SwDoc* pLocalDoc = m_pImpl->m_pDoc;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
SwTOXMark aMark(*m_pImpl->m_pTOXMark);
|
2009-06-03 11:26:39 +00:00
|
|
|
switch(pEntry->nWID)
|
|
|
|
{
|
|
|
|
case WID_ALT_TEXT:
|
2010-01-08 17:13:59 +01:00
|
|
|
aMark.SetAlternativeText(lcl_AnyToString(rValue));
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_LEVEL:
|
2010-01-08 17:13:59 +01:00
|
|
|
aMark.SetLevel(Min( static_cast<sal_Int8>( MAXLEVEL ),
|
|
|
|
static_cast<sal_Int8>(lcl_AnyToInt16(rValue)+1)));
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_PRIMARY_KEY :
|
2010-01-08 17:13:59 +01:00
|
|
|
aMark.SetPrimaryKey(lcl_AnyToString(rValue));
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_SECONDARY_KEY:
|
2010-01-08 17:13:59 +01:00
|
|
|
aMark.SetSecondaryKey(lcl_AnyToString(rValue));
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_MAIN_ENTRY:
|
2010-01-08 17:13:59 +01:00
|
|
|
aMark.SetMainEntry(lcl_AnyToBool(rValue));
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_TEXT_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
aMark.SetTextReading(lcl_AnyToString(rValue));
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_PRIMARY_KEY_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
aMark.SetPrimaryKeyReading(lcl_AnyToString(rValue));
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_SECONDARY_KEY_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
aMark.SetSecondaryKeyReading(lcl_AnyToString(rValue));
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
SwTxtTOXMark const*const pTxtMark =
|
|
|
|
m_pImpl->m_pTOXMark->GetTxtTOXMark();
|
2009-06-03 11:26:39 +00:00
|
|
|
SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart());
|
|
|
|
aPam.SetMark();
|
|
|
|
if(pTxtMark->GetEnd())
|
|
|
|
{
|
|
|
|
aPam.GetPoint()->nContent = *pTxtMark->GetEnd();
|
|
|
|
}
|
|
|
|
else
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
2009-06-03 11:26:39 +00:00
|
|
|
aPam.GetPoint()->nContent++;
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2009-06-03 11:26:39 +00:00
|
|
|
//delete the old mark
|
2010-01-08 17:13:59 +01:00
|
|
|
pLocalDoc->DeleteTOXMark(m_pImpl->m_pTOXMark);
|
|
|
|
m_pImpl->m_pTOXMark = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2009-06-03 11:26:39 +00:00
|
|
|
sal_Bool bInsAtPos = aMark.IsAlternativeText();
|
2010-01-08 17:13:59 +01:00
|
|
|
const SwPosition *pStt = aPam.Start();
|
|
|
|
const SwPosition *pEnd = aPam.End();
|
2002-02-05 13:57:52 +00:00
|
|
|
|
2009-06-03 11:26:39 +00:00
|
|
|
SwTxtAttr* pTxtAttr = 0;
|
|
|
|
if( bInsAtPos )
|
|
|
|
{
|
|
|
|
SwPaM aTmp( *pStt );
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
pLocalDoc->InsertPoolItem( aTmp, aMark, 0 );
|
|
|
|
pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttrForCharAt(
|
2009-06-03 11:26:39 +00:00
|
|
|
pStt->nContent.GetIndex()-1, RES_TXTATR_TOXMARK );
|
|
|
|
}
|
|
|
|
else if( *pEnd != *pStt )
|
|
|
|
{
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
pLocalDoc->InsertPoolItem( aPam, aMark,
|
|
|
|
nsSetAttrMode::SETATTR_DONTEXPAND );
|
2009-06-03 11:26:39 +00:00
|
|
|
pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttr(
|
|
|
|
pStt->nContent, RES_TXTATR_TOXMARK );
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_pDoc = pLocalDoc;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2009-06-03 11:26:39 +00:00
|
|
|
if(pTxtAttr)
|
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_pTOXMark = &pTxtAttr->GetTOXMark();
|
2010-01-08 17:14:00 +01:00
|
|
|
const_cast<SwTOXMark*>(m_pImpl->m_pTOXMark)->Add(m_pImpl.get());
|
2010-01-08 17:13:59 +01:00
|
|
|
pType->Add(&m_pImpl->m_TypeDepend);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
else if (m_pImpl->m_bIsDescriptor)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2009-06-03 11:26:39 +00:00
|
|
|
switch(pEntry->nWID)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
case WID_ALT_TEXT:
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_sAltText = lcl_AnyToString(rValue);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
case WID_LEVEL:
|
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
const sal_Int16 nVal = lcl_AnyToInt16(rValue);
|
2000-09-18 23:08:29 +00:00
|
|
|
if(nVal >= 0 && nVal < MAXLEVEL)
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
|
|
|
m_pImpl->m_nLevel = nVal;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:59 +01:00
|
|
|
case WID_PRIMARY_KEY:
|
|
|
|
m_pImpl->m_sPrimaryKey = lcl_AnyToString(rValue);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
case WID_SECONDARY_KEY:
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_sSecondaryKey = lcl_AnyToString(rValue);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2002-06-24 10:24:22 +00:00
|
|
|
case WID_TEXT_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_sTextReading = lcl_AnyToString(rValue);
|
2002-06-24 10:24:22 +00:00
|
|
|
break;
|
|
|
|
case WID_PRIMARY_KEY_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_sPrimaryKeyReading = lcl_AnyToString(rValue);
|
2002-06-24 10:24:22 +00:00
|
|
|
break;
|
|
|
|
case WID_SECONDARY_KEY_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_sSecondaryKeyReading = lcl_AnyToString(rValue);
|
2002-06-24 10:24:22 +00:00
|
|
|
break;
|
2010-01-08 17:13:59 +01:00
|
|
|
case WID_USER_IDX_NAME:
|
2002-01-10 12:40:48 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
OUString sTmp(lcl_AnyToString(rValue));
|
2002-01-10 12:40:48 +00:00
|
|
|
lcl_ConvertTOUNameToUserName(sTmp);
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_sUserIndexName = sTmp;
|
2002-01-10 12:40:48 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2000-12-09 13:04:51 +00:00
|
|
|
case WID_MAIN_ENTRY:
|
2010-01-08 17:13:59 +01:00
|
|
|
m_pImpl->m_bMainEntry = lcl_AnyToBool(rValue);
|
2000-12-09 13:04:51 +00:00
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 14.12.98 10:25:46---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
uno::Any SAL_CALL
|
|
|
|
SwXDocumentIndexMark::getPropertyValue(const OUString& rPropertyName)
|
|
|
|
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
uno::Any aRet;
|
2010-01-08 17:13:59 +01:00
|
|
|
SfxItemPropertySimpleEntry const*const pEntry =
|
|
|
|
m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName);
|
2009-06-03 11:26:39 +00:00
|
|
|
if (!pEntry)
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
|
|
|
throw beans::UnknownPropertyException(
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: "))
|
|
|
|
+ rPropertyName,
|
|
|
|
static_cast<cppu::OWeakObject *>(this));
|
|
|
|
}
|
2010-01-08 17:13:55 +01:00
|
|
|
if (::sw::GetDefaultTextContentValue(aRet, rPropertyName, pEntry->nWID))
|
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
return aRet;
|
2010-01-08 17:13:55 +01:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
|
|
|
SwTOXType *const pType = m_pImpl->GetTOXType();
|
|
|
|
if (pType && m_pImpl->m_pTOXMark)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2009-06-03 11:26:39 +00:00
|
|
|
switch(pEntry->nWID)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2009-06-03 11:26:39 +00:00
|
|
|
case WID_ALT_TEXT:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= OUString(m_pImpl->m_pTOXMark->GetAlternativeText());
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_LEVEL:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= static_cast<sal_Int16>(
|
|
|
|
m_pImpl->m_pTOXMark->GetLevel() - 1);
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_PRIMARY_KEY :
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= OUString(m_pImpl->m_pTOXMark->GetPrimaryKey());
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_SECONDARY_KEY:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= OUString(m_pImpl->m_pTOXMark->GetSecondaryKey());
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_TEXT_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= OUString(m_pImpl->m_pTOXMark->GetTextReading());
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_PRIMARY_KEY_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= OUString(m_pImpl->m_pTOXMark->GetPrimaryKeyReading());
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_SECONDARY_KEY_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= OUString(
|
|
|
|
m_pImpl->m_pTOXMark->GetSecondaryKeyReading());
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
|
|
|
case WID_USER_IDX_NAME :
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2009-06-03 11:26:39 +00:00
|
|
|
OUString sTmp(pType->GetTypeName());
|
|
|
|
lcl_ConvertTOUNameToProgrammaticName(sTmp);
|
|
|
|
aRet <<= sTmp;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WID_MAIN_ENTRY:
|
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
const sal_Bool bTemp = m_pImpl->m_pTOXMark->IsMainEntry();
|
|
|
|
aRet <<= bTemp;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2009-06-03 11:26:39 +00:00
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
else if (m_pImpl->m_bIsDescriptor)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2009-06-03 11:26:39 +00:00
|
|
|
switch(pEntry->nWID)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
case WID_ALT_TEXT:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= m_pImpl->m_sAltText;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
case WID_LEVEL:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= static_cast<sal_Int16>(m_pImpl->m_nLevel);
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:59 +01:00
|
|
|
case WID_PRIMARY_KEY:
|
|
|
|
aRet <<= m_pImpl->m_sPrimaryKey;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
case WID_SECONDARY_KEY:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= m_pImpl->m_sSecondaryKey;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2002-06-24 10:24:22 +00:00
|
|
|
case WID_TEXT_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= m_pImpl->m_sTextReading;
|
2002-06-24 10:24:22 +00:00
|
|
|
break;
|
|
|
|
case WID_PRIMARY_KEY_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= m_pImpl->m_sPrimaryKeyReading;
|
2002-06-24 10:24:22 +00:00
|
|
|
break;
|
|
|
|
case WID_SECONDARY_KEY_READING:
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= m_pImpl->m_sSecondaryKeyReading;
|
2002-06-24 10:24:22 +00:00
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
case WID_USER_IDX_NAME :
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= m_pImpl->m_sUserIndexName;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2000-12-09 13:04:51 +00:00
|
|
|
case WID_MAIN_ENTRY:
|
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
aRet <<= static_cast<sal_Bool>(m_pImpl->m_bMainEntry);
|
2000-12-09 13:04:51 +00:00
|
|
|
}
|
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-- 14.12.98 10:25:46---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndexMark::addPropertyChangeListener(
|
|
|
|
const ::rtl::OUString& /*rPropertyName*/,
|
|
|
|
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
|
|
|
|
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
OSL_ENSURE(false,
|
|
|
|
"SwXDocumentIndexMark::addPropertyChangeListener(): not implemented");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndexMark::removePropertyChangeListener(
|
|
|
|
const ::rtl::OUString& /*rPropertyName*/,
|
|
|
|
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
|
|
|
|
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
OSL_ENSURE(false,
|
|
|
|
"SwXDocumentIndexMark::removePropertyChangeListener(): not implemented");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndexMark::addVetoableChangeListener(
|
|
|
|
const ::rtl::OUString& /*rPropertyName*/,
|
|
|
|
const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
|
|
|
|
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
OSL_ENSURE(false,
|
|
|
|
"SwXDocumentIndexMark::addVetoableChangeListener(): not implemented");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndexMark::removeVetoableChangeListener(
|
|
|
|
const ::rtl::OUString& /*rPropertyName*/,
|
|
|
|
const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
|
|
|
|
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
OSL_ENSURE(false,
|
|
|
|
"SwXDocumentIndexMark::removeVetoableChangeListener(): not implemented");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2000-10-16 09:31:56 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
/******************************************************************
|
|
|
|
* SwXDocumentIndexes
|
|
|
|
******************************************************************/
|
|
|
|
/*-- 05.05.99 13:14:59---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndexes::SwXDocumentIndexes(SwDoc *const _pDoc)
|
|
|
|
: SwUnoCollection(_pDoc)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
/*-- 05.05.99 13:15:00---------------------------------------------------
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndexes::~SwXDocumentIndexes()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------------------06.04.00 15:08--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
OUString SAL_CALL
|
|
|
|
SwXDocumentIndexes::getImplementationName() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
return C2U("SwXDocumentIndexes");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
static char const*const g_ServicesDocumentIndexes[] =
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
"com.sun.star.text.DocumentIndexes",
|
|
|
|
};
|
|
|
|
static const size_t g_nServicesDocumentIndexes(
|
|
|
|
sizeof(g_ServicesDocumentIndexes)/sizeof(g_ServicesDocumentIndexes[0]));
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL
|
|
|
|
SwXDocumentIndexes::supportsService(const OUString& rServiceName)
|
|
|
|
throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
return ::sw::SupportsServiceImpl(
|
|
|
|
g_nServicesDocumentIndexes, g_ServicesDocumentIndexes, rServiceName);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:59 +01:00
|
|
|
uno::Sequence< OUString > SAL_CALL
|
|
|
|
SwXDocumentIndexes::getSupportedServiceNames() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
return ::sw::GetSupportedServiceNamesImpl(
|
|
|
|
g_nServicesDocumentIndexes, g_ServicesDocumentIndexes);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 05.05.99 13:15:01---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
sal_Int32 SAL_CALL
|
|
|
|
SwXDocumentIndexes::getCount() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if(!IsValid())
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
sal_uInt32 nRet = 0;
|
|
|
|
const SwSectionFmts& rFmts = GetDoc()->GetSections();
|
|
|
|
for( sal_uInt16 n = 0; n < rFmts.Count(); ++n )
|
|
|
|
{
|
|
|
|
const SwSection* pSect = rFmts[ n ]->GetSection();
|
|
|
|
if( TOX_CONTENT_SECTION == pSect->GetType() &&
|
|
|
|
pSect->GetFmt()->GetSectionNode() )
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
++nRet;
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
return nRet;
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 05.05.99 13:15:01---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
uno::Any SAL_CALL
|
|
|
|
SwXDocumentIndexes::getByIndex(sal_Int32 nIndex)
|
|
|
|
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if(!IsValid())
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2007-09-27 08:37:21 +00:00
|
|
|
sal_Int32 nIdx = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
const SwSectionFmts& rFmts = GetDoc()->GetSections();
|
2007-09-27 08:37:21 +00:00
|
|
|
for( sal_uInt16 n = 0; n < rFmts.Count(); ++n )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwSection* pSect = rFmts[ n ]->GetSection();
|
|
|
|
if( TOX_CONTENT_SECTION == pSect->GetType() &&
|
|
|
|
pSect->GetFmt()->GetSectionNode() &&
|
|
|
|
nIdx++ == nIndex )
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
|
|
|
const uno::Reference< text::XDocumentIndex > xTmp =
|
|
|
|
SwXDocumentIndex::CreateXDocumentIndex(
|
|
|
|
*GetDoc(), static_cast<SwTOXBaseSection const&>(*pSect));
|
|
|
|
uno::Any aRet;
|
|
|
|
aRet <<= xTmp;
|
|
|
|
return aRet;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IndexOutOfBoundsException();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-- 31.01.00 10:12:31---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
uno::Any SAL_CALL
|
|
|
|
SwXDocumentIndexes::getByName(const OUString& rName)
|
|
|
|
throw (container::NoSuchElementException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if(!IsValid())
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
String sToFind(rName);
|
|
|
|
const SwSectionFmts& rFmts = GetDoc()->GetSections();
|
2007-09-27 08:37:21 +00:00
|
|
|
for( sal_uInt16 n = 0; n < rFmts.Count(); ++n )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwSection* pSect = rFmts[ n ]->GetSection();
|
|
|
|
if( TOX_CONTENT_SECTION == pSect->GetType() &&
|
|
|
|
pSect->GetFmt()->GetSectionNode() &&
|
2010-01-08 17:13:59 +01:00
|
|
|
(static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName()
|
|
|
|
== sToFind))
|
|
|
|
{
|
|
|
|
const uno::Reference< text::XDocumentIndex > xTmp =
|
|
|
|
SwXDocumentIndex::CreateXDocumentIndex(
|
|
|
|
*GetDoc(), static_cast<SwTOXBaseSection const&>(*pSect));
|
|
|
|
uno::Any aRet;
|
|
|
|
aRet <<= xTmp;
|
|
|
|
return aRet;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
throw container::NoSuchElementException();
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 31.01.00 10:12:31---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
uno::Sequence< OUString > SAL_CALL
|
|
|
|
SwXDocumentIndexes::getElementNames() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if(!IsValid())
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
const SwSectionFmts& rFmts = GetDoc()->GetSections();
|
|
|
|
sal_Int32 nCount = 0;
|
|
|
|
sal_uInt16 n;
|
|
|
|
for( n = 0; n < rFmts.Count(); ++n )
|
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
SwSection const*const pSect = rFmts[ n ]->GetSection();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( TOX_CONTENT_SECTION == pSect->GetType() &&
|
|
|
|
pSect->GetFmt()->GetSectionNode() )
|
2010-01-08 17:13:59 +01:00
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
++nCount;
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence< OUString > aRet(nCount);
|
|
|
|
OUString* pArray = aRet.getArray();
|
|
|
|
sal_uInt16 nCnt;
|
|
|
|
for( n = 0, nCnt = 0; n < rFmts.Count(); ++n )
|
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
SwSection const*const pSect = rFmts[ n ]->GetSection();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( TOX_CONTENT_SECTION == pSect->GetType() &&
|
|
|
|
pSect->GetFmt()->GetSectionNode())
|
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
pArray[nCnt++] = OUString(
|
|
|
|
static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName());
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return aRet;
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 31.01.00 10:12:31---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
sal_Bool SAL_CALL
|
|
|
|
SwXDocumentIndexes::hasByName(const OUString& rName)
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if(!IsValid())
|
2007-06-05 16:33:55 +00:00
|
|
|
throw uno::RuntimeException();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
String sToFind(rName);
|
|
|
|
const SwSectionFmts& rFmts = GetDoc()->GetSections();
|
2007-09-27 08:37:21 +00:00
|
|
|
for( sal_uInt16 n = 0; n < rFmts.Count(); ++n )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
SwSection const*const pSect = rFmts[ n ]->GetSection();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( TOX_CONTENT_SECTION == pSect->GetType() &&
|
|
|
|
pSect->GetFmt()->GetSectionNode())
|
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
if (static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName()
|
|
|
|
== sToFind)
|
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
return sal_True;
|
2010-01-08 17:13:59 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return sal_False;
|
|
|
|
}
|
2010-01-08 17:13:59 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 05.05.99 13:15:01---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
uno::Type SAL_CALL
|
|
|
|
SwXDocumentIndexes::getElementType() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:59 +01:00
|
|
|
return text::XDocumentIndex::static_type();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
/*-- 05.05.99 13:15:02---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:59 +01:00
|
|
|
sal_Bool SAL_CALL
|
|
|
|
SwXDocumentIndexes::hasElements() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return 0 != getCount();
|
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
/******************************************************************
|
|
|
|
* SwXDocumentIndex::StyleAccess_Impl
|
|
|
|
******************************************************************/
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
/*-- 13.09.99 16:52:28---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndex::StyleAccess_Impl::StyleAccess_Impl(
|
|
|
|
SwXDocumentIndex& rParentIdx)
|
|
|
|
: m_xParent(&rParentIdx)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
/*-- 13.09.99 16:52:29---------------------------------------------------
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndex::StyleAccess_Impl::~StyleAccess_Impl()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------------------06.04.00 15:08--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
OUString SAL_CALL
|
|
|
|
SwXDocumentIndex::StyleAccess_Impl::getImplementationName()
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
return C2U("SwXDocumentIndex::StyleAccess_Impl");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
static char const*const g_ServicesIndexStyleAccess[] =
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
"com.sun.star.text.DocumentIndexParagraphStyles",
|
|
|
|
};
|
|
|
|
static const size_t g_nServicesIndexStyleAccess(
|
|
|
|
sizeof(g_ServicesIndexStyleAccess)/sizeof(g_ServicesIndexStyleAccess[0]));
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL
|
|
|
|
SwXDocumentIndex::StyleAccess_Impl::supportsService(
|
|
|
|
const OUString& rServiceName)
|
|
|
|
throw (uno::RuntimeException)
|
|
|
|
{
|
|
|
|
return ::sw::SupportsServiceImpl(
|
|
|
|
g_nServicesIndexStyleAccess, g_ServicesIndexStyleAccess, rServiceName);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Sequence< OUString > SAL_CALL
|
|
|
|
SwXDocumentIndex::StyleAccess_Impl::getSupportedServiceNames()
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
return ::sw::GetSupportedServiceNamesImpl(
|
|
|
|
g_nServicesIndexStyleAccess, g_ServicesIndexStyleAccess);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 13.09.99 16:52:29---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::StyleAccess_Impl::replaceByIndex(
|
|
|
|
sal_Int32 nIndex, const uno::Any& rElement)
|
|
|
|
throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
|
2007-06-05 16:33:55 +00:00
|
|
|
lang::WrappedTargetException, uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if(nIndex < 0 || nIndex > MAXLEVEL)
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IndexOutOfBoundsException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );
|
2001-07-12 09:24:14 +00:00
|
|
|
|
|
|
|
uno::Sequence<OUString> aSeq;
|
|
|
|
if(!(rElement >>= aSeq))
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
const sal_Int32 nStyles = aSeq.getLength();
|
2001-07-12 09:24:14 +00:00
|
|
|
const OUString* pStyles = aSeq.getConstArray();
|
2000-09-18 23:08:29 +00:00
|
|
|
String sSetStyles;
|
2001-08-16 11:33:56 +00:00
|
|
|
String aString;
|
2007-09-27 08:37:21 +00:00
|
|
|
for(sal_Int32 i = 0; i < nStyles; i++)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if(i)
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
sSetStyles += TOX_STYLE_DELIMITER;
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
SwStyleNameMapper::FillUIName(pStyles[i], aString,
|
|
|
|
nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True);
|
2001-08-16 11:33:56 +00:00
|
|
|
sSetStyles += aString;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
rTOXBase.SetStyleNames(sSetStyles, static_cast<sal_uInt16>(nIndex));
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
/*-- 13.09.99 16:52:29---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
sal_Int32 SAL_CALL
|
|
|
|
SwXDocumentIndex::StyleAccess_Impl::getCount() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return MAXLEVEL;
|
|
|
|
}
|
|
|
|
/*-- 13.09.99 16:52:30---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Any SAL_CALL
|
|
|
|
SwXDocumentIndex::StyleAccess_Impl::getByIndex(sal_Int32 nIndex)
|
|
|
|
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if(nIndex < 0 || nIndex > MAXLEVEL)
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IndexOutOfBoundsException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
const String& rStyles =
|
|
|
|
rTOXBase.GetStyleNames(static_cast<sal_uInt16>(nIndex));
|
|
|
|
const sal_uInt16 nStyles = rStyles.GetTokenCount(TOX_STYLE_DELIMITER);
|
2000-09-18 23:08:29 +00:00
|
|
|
uno::Sequence<OUString> aStyles(nStyles);
|
|
|
|
OUString* pStyles = aStyles.getArray();
|
2001-08-16 11:33:56 +00:00
|
|
|
String aString;
|
2000-09-18 23:08:29 +00:00
|
|
|
for(sal_uInt16 i = 0; i < nStyles; i++)
|
|
|
|
{
|
2001-08-16 11:33:56 +00:00
|
|
|
SwStyleNameMapper::FillProgName(
|
|
|
|
rStyles.GetToken(i, TOX_STYLE_DELIMITER),
|
|
|
|
aString,
|
2007-09-27 08:37:21 +00:00
|
|
|
nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL,
|
2001-08-16 11:33:56 +00:00
|
|
|
sal_True);
|
|
|
|
pStyles[i] = OUString( aString );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
uno::Any aRet(&aStyles, ::getCppuType((uno::Sequence<OUString>*)0));
|
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
/*-- 13.09.99 16:52:30---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Type SAL_CALL
|
|
|
|
SwXDocumentIndex::StyleAccess_Impl::getElementType()
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return ::getCppuType((uno::Sequence<OUString>*)0);
|
|
|
|
}
|
|
|
|
/*-- 13.09.99 16:52:30---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
sal_Bool SAL_CALL
|
|
|
|
SwXDocumentIndex::StyleAccess_Impl::hasElements() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
/******************************************************************
|
|
|
|
* SwXDocumentIndex::TokenAccess_Impl
|
|
|
|
******************************************************************/
|
|
|
|
/*-- 13.09.99 16:52:28---------------------------------------------------
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndex::TokenAccess_Impl::TokenAccess_Impl(
|
|
|
|
SwXDocumentIndex& rParentIdx)
|
|
|
|
: m_xParent(&rParentIdx)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
/*-- 13.09.99 16:52:29---------------------------------------------------
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwXDocumentIndex::TokenAccess_Impl::~TokenAccess_Impl()
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/* -----------------------------06.04.00 15:08--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
OUString SAL_CALL
|
|
|
|
SwXDocumentIndex::TokenAccess_Impl::getImplementationName()
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
return C2U("SwXDocumentIndex::TokenAccess_Impl");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
static char const*const g_ServicesIndexTokenAccess[] =
|
|
|
|
{
|
|
|
|
"com.sun.star.text.DocumentIndexLevelFormat",
|
|
|
|
};
|
|
|
|
static const size_t g_nServicesIndexTokenAccess(
|
|
|
|
sizeof(g_ServicesIndexTokenAccess)/sizeof(g_ServicesIndexTokenAccess[0]));
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL
|
|
|
|
SwXDocumentIndex::TokenAccess_Impl::supportsService(
|
|
|
|
const OUString& rServiceName)
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
return ::sw::SupportsServiceImpl(
|
|
|
|
g_nServicesIndexTokenAccess, g_ServicesIndexTokenAccess, rServiceName);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Sequence< OUString > SAL_CALL
|
|
|
|
SwXDocumentIndex::TokenAccess_Impl::getSupportedServiceNames()
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
return ::sw::GetSupportedServiceNamesImpl(
|
|
|
|
g_nServicesIndexTokenAccess, g_ServicesIndexTokenAccess);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
|
|
|
struct TokenType {
|
|
|
|
const char *pName;
|
|
|
|
const enum FormTokenType eTokenType;
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct TokenType g_TokenTypes[] =
|
|
|
|
{
|
|
|
|
{ "TokenEntryNumber", TOKEN_ENTRY_NO },
|
|
|
|
{ "TokenEntryText", TOKEN_ENTRY_TEXT },
|
|
|
|
{ "TokenTabStop", TOKEN_TAB_STOP },
|
|
|
|
{ "TokenText", TOKEN_TEXT },
|
|
|
|
{ "TokenPageNumber", TOKEN_PAGE_NUMS },
|
|
|
|
{ "TokenChapterInfo", TOKEN_CHAPTER_INFO },
|
|
|
|
{ "TokenHyperlinkStart", TOKEN_LINK_START },
|
|
|
|
{ "TokenHyperlinkEnd", TOKEN_LINK_END },
|
|
|
|
{ "TokenBibliographyDataField", TOKEN_AUTHORITY },
|
|
|
|
{ 0, static_cast<enum FormTokenType>(0) }
|
|
|
|
};
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 13.09.99 16:52:29---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
void SAL_CALL
|
|
|
|
SwXDocumentIndex::TokenAccess_Impl::replaceByIndex(
|
|
|
|
sal_Int32 nIndex, const uno::Any& rElement)
|
|
|
|
throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
|
|
|
|
lang::WrappedTargetException, uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
if ((nIndex < 0) || (nIndex > rTOXBase.GetTOXForm().GetFormMax()))
|
|
|
|
{
|
|
|
|
throw lang::IndexOutOfBoundsException();
|
|
|
|
}
|
2001-07-12 09:24:14 +00:00
|
|
|
|
2007-06-05 16:33:55 +00:00
|
|
|
uno::Sequence<beans::PropertyValues> aSeq;
|
2001-07-12 09:24:14 +00:00
|
|
|
if(!(rElement >>= aSeq))
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
String sPattern;
|
2010-01-08 17:13:58 +01:00
|
|
|
const sal_Int32 nTokens = aSeq.getLength();
|
2007-06-05 16:33:55 +00:00
|
|
|
const beans::PropertyValues* pTokens = aSeq.getConstArray();
|
2007-09-27 08:37:21 +00:00
|
|
|
for(sal_Int32 i = 0; i < nTokens; i++)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
const beans::PropertyValue* pProperties = pTokens[i].getConstArray();
|
2010-01-08 17:13:58 +01:00
|
|
|
const sal_Int32 nProperties = pTokens[i].getLength();
|
2000-09-18 23:08:29 +00:00
|
|
|
//create an invalid token
|
|
|
|
SwFormToken aToken(TOKEN_END);
|
2007-09-27 08:37:21 +00:00
|
|
|
for(sal_Int32 j = 0; j < nProperties; j++)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
if (pProperties[j].Name.equalsAscii("TokenType"))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const OUString sTokenType =
|
2000-09-18 23:08:29 +00:00
|
|
|
lcl_AnyToString(pProperties[j].Value);
|
2010-01-08 17:13:58 +01:00
|
|
|
for (TokenType const* pTokenType = g_TokenTypes;
|
|
|
|
pTokenType->pName; ++pTokenType)
|
|
|
|
{
|
|
|
|
if (sTokenType.equalsAscii(pTokenType->pName))
|
|
|
|
{
|
|
|
|
aToken.eTokenType = pTokenType->eTokenType;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
else if (pProperties[j].Name.equalsAsciiL(
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("CharacterStyleName")))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2001-08-16 11:33:56 +00:00
|
|
|
String sCharStyleName;
|
|
|
|
SwStyleNameMapper::FillUIName(
|
2000-11-01 10:03:32 +00:00
|
|
|
lcl_AnyToString(pProperties[j].Value),
|
2001-08-16 11:33:56 +00:00
|
|
|
sCharStyleName,
|
2007-09-27 08:37:21 +00:00
|
|
|
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT,
|
2001-08-16 11:33:56 +00:00
|
|
|
sal_True);
|
2000-09-18 23:08:29 +00:00
|
|
|
aToken.sCharStyleName = sCharStyleName;
|
2001-07-20 09:22:01 +00:00
|
|
|
aToken.nPoolId = SwStyleNameMapper::GetPoolIdFromUIName (
|
2010-01-08 17:13:58 +01:00
|
|
|
sCharStyleName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
else if (pProperties[j].Name.equalsAsciiL(
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("TabStopRightAligned")))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const sal_Bool bRight = lcl_AnyToBool(pProperties[j].Value);
|
2000-09-18 23:08:29 +00:00
|
|
|
aToken.eTabAlign = bRight ?
|
|
|
|
SVX_TAB_ADJUST_END : SVX_TAB_ADJUST_LEFT;
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
else if (pProperties[j].Name.equalsAsciiL(
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("TabStopPosition")))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-11-12 15:27:16 +00:00
|
|
|
sal_Int32 nPosition = 0;
|
2010-01-08 17:13:58 +01:00
|
|
|
if (!(pProperties[j].Value >>= nPosition))
|
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
nPosition = MM100_TO_TWIP(nPosition);
|
|
|
|
if(nPosition < 0)
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
aToken.nTabStopPosition = nPosition;
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
else if (pProperties[j].Name.equalsAsciiL(
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("TabStopFillCharacter")))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const OUString sFillChar =
|
2000-09-18 23:08:29 +00:00
|
|
|
lcl_AnyToString(pProperties[j].Value);
|
2010-01-08 17:13:58 +01:00
|
|
|
if (sFillChar.getLength() > 1)
|
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
|
|
|
aToken.cTabFillChar =
|
|
|
|
(sFillChar.getLength()) ? sFillChar[0] : ' ';
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
else if (pProperties[j].Name.equalsAsciiL(
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("Text")))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
const OUString sText = lcl_AnyToString(pProperties[j].Value);
|
2000-09-18 23:08:29 +00:00
|
|
|
aToken.sText = sText;
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
else if (pProperties[j].Name.equalsAsciiL(
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("ChapterFormat")))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
sal_Int16 nFormat = lcl_AnyToInt16(pProperties[j].Value);
|
|
|
|
switch(nFormat)
|
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
case text::ChapterFormat::NUMBER:
|
|
|
|
nFormat = CF_NUMBER;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case text::ChapterFormat::NAME:
|
|
|
|
nFormat = CF_TITLE;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case text::ChapterFormat::NAME_NUMBER:
|
|
|
|
nFormat = CF_NUM_TITLE;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case text::ChapterFormat::NO_PREFIX_SUFFIX:
|
|
|
|
nFormat = CF_NUMBER_NOPREPST;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case text::ChapterFormat::DIGIT:
|
|
|
|
nFormat = CF_NUM_NOPREPST_TITLE;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
default:
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
aToken.nChapterFormat = nFormat;
|
|
|
|
}
|
2008-03-07 11:00:59 +00:00
|
|
|
//--->i53420
|
2010-01-08 17:13:58 +01:00
|
|
|
else if (pProperties[j].Name.equalsAsciiL(
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("ChapterLevel")))
|
2008-03-07 11:00:59 +00:00
|
|
|
{
|
|
|
|
const sal_Int16 nLevel = lcl_AnyToInt16(pProperties[j].Value);
|
|
|
|
if( nLevel < 1 || nLevel > MAXLEVEL )
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2008-03-07 11:00:59 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2008-03-07 11:00:59 +00:00
|
|
|
aToken.nOutlineLevel = nLevel;
|
|
|
|
}
|
|
|
|
//<---
|
2010-01-08 17:13:58 +01:00
|
|
|
else if (pProperties[j].Name.equalsAsciiL(
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("BibliographyDataField")))
|
2000-10-27 11:59:47 +00:00
|
|
|
{
|
2007-11-12 15:27:16 +00:00
|
|
|
sal_Int16 nType = 0;
|
|
|
|
pProperties[j].Value >>= nType;
|
2007-06-05 16:33:55 +00:00
|
|
|
if(nType < 0 || nType > text::BibliographyDataField::ISBN)
|
2000-10-27 11:59:47 +00:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
lang::IllegalArgumentException aExcept;
|
2000-10-27 11:59:47 +00:00
|
|
|
aExcept.Message = C2U("BibliographyDataField - wrong value");
|
2007-09-27 08:37:21 +00:00
|
|
|
aExcept.ArgumentPosition = static_cast< sal_Int16 >(j);
|
2000-10-27 11:59:47 +00:00
|
|
|
throw aExcept;
|
|
|
|
}
|
|
|
|
aToken.nAuthorityField = nType;
|
|
|
|
}
|
2004-05-17 15:24:45 +00:00
|
|
|
// #i21237#
|
2010-01-08 17:13:58 +01:00
|
|
|
else if (pProperties[j].Name.equalsAsciiL(
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("WithTab")))
|
2004-05-17 15:24:45 +00:00
|
|
|
{
|
|
|
|
aToken.bWithTab = lcl_AnyToBool(pProperties[j].Value);
|
|
|
|
}
|
2000-10-27 11:59:47 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
//exception if wrong TokenType
|
|
|
|
if(TOKEN_END <= aToken.eTokenType )
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IllegalArgumentException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
// set TokenType from TOKEN_ENTRY_TEXT to TOKEN_ENTRY if it is
|
|
|
|
// not a content index
|
|
|
|
if(TOKEN_ENTRY_TEXT == aToken.eTokenType &&
|
2010-01-08 17:13:58 +01:00
|
|
|
(TOX_CONTENT != rTOXBase.GetType()))
|
|
|
|
{
|
2000-11-01 10:03:32 +00:00
|
|
|
aToken.eTokenType = TOKEN_ENTRY;
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2008-03-07 11:00:59 +00:00
|
|
|
//---> i53420
|
|
|
|
// check for chapter format allowed values if it was TOKEN_ENTRY_NO type
|
|
|
|
// only allowed value are CF_NUMBER and CF_NUM_NOPREPST_TITLE
|
|
|
|
// reading from file
|
|
|
|
if( TOKEN_ENTRY_NO == aToken.eTokenType )
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2008-03-07 11:00:59 +00:00
|
|
|
switch(aToken.nChapterFormat)
|
|
|
|
{
|
|
|
|
case CF_NUMBER:
|
|
|
|
case CF_NUM_NOPREPST_TITLE:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
throw lang::IllegalArgumentException();
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2008-03-07 11:00:59 +00:00
|
|
|
//<---
|
2000-11-01 10:03:32 +00:00
|
|
|
sPattern += aToken.GetString();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
SwForm aForm(rTOXBase.GetTOXForm());
|
|
|
|
aForm.SetPattern(static_cast<sal_uInt16>(nIndex), sPattern);
|
|
|
|
rTOXBase.SetTOXForm(aForm);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 13.09.99 16:52:29---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
sal_Int32 SAL_CALL
|
|
|
|
SwXDocumentIndex::TokenAccess_Impl::getCount() throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
const sal_Int32 nRet = m_xParent->m_pImpl->GetFormMax();
|
2000-09-18 23:08:29 +00:00
|
|
|
return nRet;
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 13.09.99 16:52:30---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Any SAL_CALL
|
|
|
|
SwXDocumentIndex::TokenAccess_Impl::getByIndex(sal_Int32 nIndex)
|
|
|
|
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
|
|
|
|
uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
vos::OGuard aGuard(Application::GetSolarMutex());
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
if ((nIndex < 0) || (nIndex > rTOXBase.GetTOXForm().GetFormMax()))
|
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
throw lang::IndexOutOfBoundsException();
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-05-17 15:24:45 +00:00
|
|
|
// #i21237#
|
2010-01-08 17:13:58 +01:00
|
|
|
SwFormTokens aPattern = rTOXBase.GetTOXForm().
|
|
|
|
GetPattern(static_cast<sal_uInt16>(nIndex));
|
2004-05-17 15:24:45 +00:00
|
|
|
SwFormTokens::iterator aIt = aPattern.begin();
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
sal_uInt16 nTokenCount = 0;
|
2007-06-05 16:33:55 +00:00
|
|
|
uno::Sequence< beans::PropertyValues > aRetSeq;
|
2001-08-16 11:33:56 +00:00
|
|
|
String aString;
|
2004-05-17 15:24:45 +00:00
|
|
|
while(aIt != aPattern.end()) // #i21237#
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
nTokenCount++;
|
|
|
|
aRetSeq.realloc(nTokenCount);
|
2007-06-05 16:33:55 +00:00
|
|
|
beans::PropertyValues* pTokenProps = aRetSeq.getArray();
|
2004-05-17 15:24:45 +00:00
|
|
|
SwFormToken aToken = *aIt; // #i21237#
|
2000-10-27 08:23:18 +00:00
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Sequence< beans::PropertyValue >& rCurTokenSeq =
|
|
|
|
pTokenProps[nTokenCount-1];
|
2001-08-16 11:33:56 +00:00
|
|
|
SwStyleNameMapper::FillProgName(
|
|
|
|
aToken.sCharStyleName,
|
|
|
|
aString,
|
2007-09-27 08:37:21 +00:00
|
|
|
nsSwGetPoolIdFromName::GET_POOLID_CHRFMT,
|
2001-08-16 11:33:56 +00:00
|
|
|
sal_True );
|
|
|
|
const OUString aProgCharStyle( aString );
|
2000-09-18 23:08:29 +00:00
|
|
|
switch(aToken.eTokenType)
|
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
case TOKEN_ENTRY_NO:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2008-03-07 11:00:59 +00:00
|
|
|
//--->i53420
|
|
|
|
// writing to file (from doc to properties)
|
|
|
|
sal_Int32 nElements = 2;
|
|
|
|
sal_Int32 nCurrentElement = 0;
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
// check for default value
|
|
|
|
if (aToken.nChapterFormat != CF_NUMBER)
|
|
|
|
{
|
2008-03-07 11:00:59 +00:00
|
|
|
nElements++;//we need the element
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2008-03-07 11:00:59 +00:00
|
|
|
if( aToken.nOutlineLevel != MAXLEVEL )
|
2010-01-08 17:13:58 +01:00
|
|
|
{
|
2008-03-07 11:00:59 +00:00
|
|
|
nElements++;
|
2010-01-08 17:13:58 +01:00
|
|
|
}
|
2008-03-07 11:00:59 +00:00
|
|
|
|
|
|
|
rCurTokenSeq.realloc( nElements );
|
|
|
|
|
2007-06-05 16:33:55 +00:00
|
|
|
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2008-03-07 11:00:59 +00:00
|
|
|
pArr[nCurrentElement].Name = C2U("TokenType");
|
2010-01-08 17:13:58 +01:00
|
|
|
pArr[nCurrentElement++].Value <<=
|
|
|
|
OUString::createFromAscii("TokenEntryNumber");
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2008-03-07 11:00:59 +00:00
|
|
|
pArr[nCurrentElement].Name = C2U("CharacterStyleName");
|
|
|
|
pArr[nCurrentElement++].Value <<= aProgCharStyle;
|
|
|
|
if( aToken.nChapterFormat != CF_NUMBER )
|
|
|
|
{
|
|
|
|
pArr[nCurrentElement].Name = C2U("ChapterFormat");
|
|
|
|
sal_Int16 nVal;
|
2010-01-08 17:13:58 +01:00
|
|
|
// the allowed values for chapter format, when used as entry number,
|
|
|
|
// are CF_NUMBER and CF_NUM_NOPREPST_TITLE only, all else forced to
|
2008-03-07 11:00:59 +00:00
|
|
|
//CF_NUMBER
|
|
|
|
switch(aToken.nChapterFormat)
|
|
|
|
{
|
|
|
|
default:
|
2010-01-08 17:13:58 +01:00
|
|
|
case CF_NUMBER:
|
|
|
|
nVal = text::ChapterFormat::NUMBER;
|
|
|
|
break;
|
|
|
|
case CF_NUM_NOPREPST_TITLE:
|
|
|
|
nVal = text::ChapterFormat::DIGIT;
|
|
|
|
break;
|
2008-03-07 11:00:59 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
pArr[nCurrentElement++].Value <<= nVal;
|
2008-03-07 11:00:59 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
// only a ChapterLevel != MAXLEVEL is registered
|
|
|
|
if (aToken.nOutlineLevel != MAXLEVEL)
|
2008-03-07 11:00:59 +00:00
|
|
|
{
|
|
|
|
pArr[nCurrentElement].Name = C2U("ChapterLevel");
|
|
|
|
pArr[nCurrentElement].Value <<= aToken.nOutlineLevel;
|
|
|
|
}
|
|
|
|
//<---
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case TOKEN_ENTRY: // no difference between Entry and Entry Text
|
|
|
|
case TOKEN_ENTRY_TEXT:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2000-10-27 08:23:18 +00:00
|
|
|
rCurTokenSeq.realloc( 2 );
|
2007-06-05 16:33:55 +00:00
|
|
|
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pArr[0].Name = C2U("TokenType");
|
|
|
|
pArr[0].Value <<= OUString::createFromAscii("TokenEntryText");
|
|
|
|
|
|
|
|
pArr[1].Name = C2U("CharacterStyleName");
|
2001-06-27 12:48:31 +00:00
|
|
|
pArr[1].Value <<= aProgCharStyle;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case TOKEN_TAB_STOP:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-05-17 15:24:45 +00:00
|
|
|
rCurTokenSeq.realloc(5); // #i21237#
|
2007-06-05 16:33:55 +00:00
|
|
|
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pArr[0].Name = C2U("TokenType");
|
|
|
|
pArr[0].Value <<= OUString::createFromAscii("TokenTabStop");
|
|
|
|
|
|
|
|
if(SVX_TAB_ADJUST_END == aToken.eTabAlign)
|
|
|
|
{
|
|
|
|
pArr[1].Name = C2U("TabStopRightAligned");
|
|
|
|
BOOL bTemp = sal_True;
|
|
|
|
pArr[1].Value.setValue(&bTemp, ::getCppuBooleanType());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pArr[1].Name = C2U("TabStopPosition");
|
2001-03-30 10:40:04 +00:00
|
|
|
sal_Int32 nPos = (TWIP_TO_MM100(aToken.nTabStopPosition));
|
|
|
|
if(nPos < 0)
|
|
|
|
nPos = 0;
|
|
|
|
pArr[1].Value <<= (sal_Int32)nPos;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
pArr[2].Name = C2U("TabStopFillCharacter");
|
|
|
|
pArr[2].Value <<= OUString(aToken.cTabFillChar);
|
2001-06-27 12:48:31 +00:00
|
|
|
pArr[3].Name = C2U("CharacterStyleName");
|
|
|
|
pArr[3].Value <<= aProgCharStyle;
|
2004-05-17 15:24:45 +00:00
|
|
|
// #i21237#
|
|
|
|
pArr[4].Name = C2U("WithTab");
|
2010-01-08 17:13:58 +01:00
|
|
|
pArr[4].Value <<= static_cast<sal_Bool>(aToken.bWithTab);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case TOKEN_TEXT:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2000-10-27 08:23:18 +00:00
|
|
|
rCurTokenSeq.realloc( 3 );
|
2007-06-05 16:33:55 +00:00
|
|
|
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pArr[0].Name = C2U("TokenType");
|
|
|
|
pArr[0].Value <<= OUString::createFromAscii("TokenText");
|
|
|
|
|
|
|
|
pArr[1].Name = C2U("CharacterStyleName");
|
2001-06-27 12:48:31 +00:00
|
|
|
pArr[1].Value <<= aProgCharStyle;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pArr[2].Name = C2U("Text");
|
|
|
|
pArr[2].Value <<= OUString(aToken.sText);
|
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case TOKEN_PAGE_NUMS:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2000-10-27 08:23:18 +00:00
|
|
|
rCurTokenSeq.realloc( 2 );
|
2007-06-05 16:33:55 +00:00
|
|
|
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pArr[0].Name = C2U("TokenType");
|
|
|
|
pArr[0].Value <<= OUString::createFromAscii("TokenPageNumber");
|
|
|
|
|
|
|
|
pArr[1].Name = C2U("CharacterStyleName");
|
2001-06-27 12:48:31 +00:00
|
|
|
pArr[1].Value <<= aProgCharStyle;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case TOKEN_CHAPTER_INFO:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2008-03-07 11:00:59 +00:00
|
|
|
rCurTokenSeq.realloc( 4 );
|
2007-06-05 16:33:55 +00:00
|
|
|
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pArr[0].Name = C2U("TokenType");
|
|
|
|
pArr[0].Value <<= OUString::createFromAscii("TokenChapterInfo");
|
|
|
|
|
|
|
|
pArr[1].Name = C2U("CharacterStyleName");
|
2001-06-27 12:48:31 +00:00
|
|
|
pArr[1].Value <<= aProgCharStyle;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pArr[2].Name = C2U("ChapterFormat");
|
|
|
|
sal_Int16 nVal = text::ChapterFormat::NUMBER;
|
|
|
|
switch(aToken.nChapterFormat)
|
|
|
|
{
|
2010-01-08 17:13:58 +01:00
|
|
|
case CF_NUMBER:
|
|
|
|
nVal = text::ChapterFormat::NUMBER;
|
|
|
|
break;
|
|
|
|
case CF_TITLE:
|
|
|
|
nVal = text::ChapterFormat::NAME;
|
|
|
|
break;
|
|
|
|
case CF_NUM_TITLE:
|
|
|
|
nVal = text::ChapterFormat::NAME_NUMBER;
|
|
|
|
break;
|
|
|
|
case CF_NUMBER_NOPREPST:
|
|
|
|
nVal = text::ChapterFormat::NO_PREFIX_SUFFIX;
|
|
|
|
break;
|
|
|
|
case CF_NUM_NOPREPST_TITLE:
|
|
|
|
nVal = text::ChapterFormat::DIGIT;
|
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
pArr[2].Value <<= nVal;
|
2008-03-07 11:00:59 +00:00
|
|
|
//--->i53420
|
|
|
|
pArr[3].Name = C2U("ChapterLevel");
|
|
|
|
//
|
|
|
|
pArr[3].Value <<= aToken.nOutlineLevel;
|
|
|
|
//<---
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case TOKEN_LINK_START:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-01-05 14:57:38 +00:00
|
|
|
rCurTokenSeq.realloc( 2 );
|
2007-06-05 16:33:55 +00:00
|
|
|
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pArr[0].Name = C2U("TokenType");
|
2010-01-08 17:13:58 +01:00
|
|
|
pArr[0].Value <<=
|
|
|
|
OUString::createFromAscii("TokenHyperlinkStart");
|
2004-01-05 14:57:38 +00:00
|
|
|
pArr[1].Name = C2U("CharacterStyleName");
|
|
|
|
pArr[1].Value <<= aProgCharStyle;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case TOKEN_LINK_END:
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2000-10-27 08:23:18 +00:00
|
|
|
rCurTokenSeq.realloc( 1 );
|
2007-06-05 16:33:55 +00:00
|
|
|
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pArr[0].Name = C2U("TokenType");
|
2010-01-08 17:13:58 +01:00
|
|
|
pArr[0].Value <<=
|
|
|
|
OUString::createFromAscii("TokenHyperlinkEnd");
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-01-08 17:13:58 +01:00
|
|
|
case TOKEN_AUTHORITY:
|
2007-09-27 08:37:21 +00:00
|
|
|
{
|
2001-06-15 09:01:58 +00:00
|
|
|
rCurTokenSeq.realloc( 3 );
|
2007-06-05 16:33:55 +00:00
|
|
|
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
pArr[0].Name = C2U("TokenType");
|
2010-01-08 17:13:58 +01:00
|
|
|
pArr[0].Value <<=
|
|
|
|
OUString::createFromAscii("TokenBibliographyDataField");
|
2001-06-15 09:01:58 +00:00
|
|
|
|
|
|
|
pArr[1].Name = C2U("CharacterStyleName");
|
2001-06-27 12:48:31 +00:00
|
|
|
pArr[1].Value <<= aProgCharStyle;
|
2001-06-15 09:01:58 +00:00
|
|
|
|
|
|
|
pArr[2].Name = C2U("BibliographyDataField");
|
|
|
|
pArr[2].Value <<= sal_Int16(aToken.nAuthorityField);
|
2007-09-27 08:37:21 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2007-09-27 08:37:21 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2004-05-17 15:24:45 +00:00
|
|
|
|
|
|
|
aIt++; // #i21237#
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Any aRet;
|
|
|
|
aRet <<= aRetSeq;
|
2000-09-18 23:08:29 +00:00
|
|
|
return aRet;
|
|
|
|
}
|
2010-01-08 17:13:58 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*-- 13.09.99 16:52:30---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
uno::Type SAL_CALL
|
|
|
|
SwXDocumentIndex::TokenAccess_Impl::getElementType()
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-06-05 16:33:55 +00:00
|
|
|
return ::getCppuType((uno::Sequence< beans::PropertyValues >*)0);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
/*-- 13.09.99 16:52:30---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2010-01-08 17:13:58 +01:00
|
|
|
sal_Bool SAL_CALL
|
|
|
|
SwXDocumentIndex::TokenAccess_Impl::hasElements()
|
|
|
|
throw (uno::RuntimeException)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|