LibreOffice Module sw (master)  1
fmtfollowtextflow.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <fmtfollowtextflow.hxx>
21 #include <unomid.h>
22 
23 #include <sal/log.hxx>
24 
25 
27 {
28  return new SwFormatFollowTextFlow(*this);
29 }
30 
31 
32 bool SwFormatFollowTextFlow::PutValue(const css::uno::Any& rVal, sal_uInt8 aInt)
33 {
34  switch( aInt )
35  {
37  {
38  bool bTheValue = bool();
39  if (rVal >>= bTheValue)
40  {
41  SetValue( bTheValue );
42  return true;
43  }
44  break;
45  }
47  {
48  bool bTheValue = bool();
49  if (rVal >>= bTheValue)
50  {
51  mbLayoutInCell = bTheValue;
52  return true;
53  }
54  break;
55  }
56  }
57  SAL_WARN("sw.ui", "SfxBoolItem::PutValue(): Wrong type");
58  return false;
59 }
60 
61 
62 bool SwFormatFollowTextFlow::QueryValue(css::uno::Any& rVal, sal_uInt8 aInt) const
63 {
64  switch( aInt )
65  {
67  {
68  rVal <<= GetValue();
69  break;
70  }
72  {
73  rVal <<= GetLayoutInCell();
74  break;
75  }
76  }
77  return true;
78 }
79 
81 {
82  assert(dynamic_cast<const SwFormatFollowTextFlow*>(&rItem) != nullptr);
83  return SfxBoolItem::operator==(rItem)
84  && mbLayoutInCell == static_cast<SwFormatFollowTextFlow const*>(&rItem)->mbLayoutInCell;
85 }
86 
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetValue() const
SwFormatFollowTextFlow(bool bFlag=false)
#define MID_FTF_LAYOUT_IN_CELL
Definition: unomid.h:152
virtual bool operator==(const SfxPoolItem &rItem) const override
#define MID_FOLLOW_TEXT_FLOW
Definition: unomid.h:151
bool PutValue(const css::uno::Any &rVal, sal_uInt8 aInt) override
bool operator==(const SfxPoolItem &rItem) const override
void SetValue(bool const bTheValue)
bool QueryValue(css::uno::Any &rVal, sal_uInt8 aInt=0) const override
unsigned char sal_uInt8
#define SAL_WARN(area, stream)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
"pure virtual methods" of SfxPoolItem