diff options
author | matteocam <matteo.campanelli@gmail.com> | 2015-09-06 11:26:43 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-09-20 13:05:14 +0200 |
commit | 089cae1ce1e69d5a01756109d95817f6a87a2bea (patch) | |
tree | 1d1d93a9445e21a0fa6a8178df2d9e36881c882f /svx | |
parent | 0c0dedb9e4a24f09a46e077ddd0bc36de7b5c575 (diff) |
chained editeng: Add TextChain related files
Change-Id: I3fbf9d60cf1d1e022b33bb5b416c88847a1efc64
Diffstat (limited to 'svx')
-rw-r--r-- | svx/Library_svxcore.mk | 1 | ||||
-rw-r--r-- | svx/source/svdraw/textchain.cxx | 68 |
2 files changed, 69 insertions, 0 deletions
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 89b1eb0b89f2..9c22634dd9d2 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -339,6 +339,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/svdraw/svdview \ svx/source/svdraw/svdviter \ svx/source/svdraw/svdxcgv \ + svx/source/svdraw/textchain \ svx/source/styles/CommonStylePreviewRenderer \ svx/source/styles/CommonStyleManager \ svx/source/styles/ColorSets \ diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx new file mode 100644 index 000000000000..b7146c12f7bb --- /dev/null +++ b/svx/source/svdraw/textchain.cxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include <svx/textchain.hxx> +#include <svx/svdotext.hxx> +#include <svx/svdpage.hxx> + +/* + * Definition of Properties Interface +*/ + +IMPL_CHAIN_PROP_INTERFACE(CursorEvent, CursorChainingEvent) +IMPL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool) +IMPL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection) +IMPL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection) +IMPL_CHAIN_PROP_INTERFACE(IsPartOfLastParaInNextLink, bool) +IMPL_CHAIN_PROP_INTERFACE(PendingOverflowCheck, bool) +IMPL_CHAIN_PROP_INTERFACE(SwitchingToNextBox, bool) + + +/* End Definition of Properties Interface */ + +/* TextChain */ + +// NOTE: All getters in the class assume that the guy is in the chain + +TextChain::TextChain() +{ +} + +TextChain::~TextChain() +{ + // XXX: Should free all LinkProperties +} + +ImpChainLinkProperties *TextChain::GetLinkProperties(const SdrTextObj *pLink) +{ + // if the guy does not already have properties in the map make them + ChainLinkId aLinkId = GetId(pLink); + if (maLinkPropertiesMap.find(aLinkId) == maLinkPropertiesMap.end()) { + maLinkPropertiesMap[aLinkId] = new ImpChainLinkProperties; + } + + return maLinkPropertiesMap[aLinkId]; +} + +ChainLinkId TextChain::GetId(const SdrTextObj *pLink) const +{ + return pLink->GetName(); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |