summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/tabpages/border.cxx8
-rw-r--r--include/svl/int64item.hxx56
-rw-r--r--include/svx/svxids.hrc3
-rw-r--r--sc/source/ui/view/tabvwsha.cxx8
-rw-r--r--svl/Library_svl.mk1
-rw-r--r--svl/source/items/int64item.cxx109
6 files changed, 183 insertions, 2 deletions
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index a2d19a531e25..3f8881bc4657 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -41,6 +41,7 @@
#include <sfx2/request.hxx>
#include <svl/intitem.hxx>
#include <svl/ilstitem.hxx>
+#include <svl/int64item.hxx>
#include <sfx2/itemconnect.hxx>
#include <sal/macros.h>
#include "borderconn.hxx"
@@ -167,6 +168,13 @@ SvxBorderTabPage::SvxBorderTabPage(Window* pParent, const SfxItemSet& rCoreAttrs
maUsedBorderStyles.insert(static_cast<sal_Int16>(aUsedStyles[i]));
}
+ if (rCoreAttrs.HasItem(SID_ATTR_BORDER_DEFAULT_WIDTH, &pItem))
+ {
+ // The caller specifies default line width. Honor it.
+ const SfxInt64Item* p = static_cast<const SfxInt64Item*>(pItem);
+ m_pLineWidthMF->SetValue(p->GetValue());
+ }
+
// set metric
FieldUnit eFUnit = GetModuleFieldUnit( rCoreAttrs );
diff --git a/include/svl/int64item.hxx b/include/svl/int64item.hxx
new file mode 100644
index 000000000000..2d6fd676417a
--- /dev/null
+++ b/include/svl/int64item.hxx
@@ -0,0 +1,56 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_SVL_INT64ITEM_HXX
+#define INCLUDED_SVL_INT64ITEM_HXX
+
+#include <svl/poolitem.hxx>
+#include <svl/svldllapi.h>
+
+class SVL_DLLPUBLIC SfxInt64Item : public SfxPoolItem
+{
+ sal_Int64 mnValue;
+
+public:
+ SfxInt64Item( sal_uInt16 nWhich = 0, sal_Int64 nVal = 0 );
+ SfxInt64Item( sal_uInt16 nWhich, SvStream & rStream );
+ SfxInt64Item( const SfxInt64Item& rItem );
+
+ virtual ~SfxInt64Item();
+
+ virtual bool operator== ( const SfxPoolItem& rItem ) const;
+
+ virtual int Compare( const SfxPoolItem& r ) const;
+ virtual int Compare( const SfxPoolItem& r, const IntlWrapper& rIntlWrapper ) const;
+
+ virtual SfxItemPresentation GetPresentation(
+ SfxItemPresentation, SfxMapUnit, SfxMapUnit,
+ OUString& rText, const IntlWrapper* pIntlWrapper = NULL ) const;
+
+ virtual bool QueryValue(
+ com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+
+ virtual bool PutValue(
+ const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+
+ virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nItemVersion ) const;
+
+ virtual SvStream& Store( SvStream& rStream, sal_uInt16 nItemVersion ) const;
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pOther = NULL ) const;
+
+ sal_Int64 GetValue() const;
+
+ void SetValue( sal_Int64 nVal );
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index ae66d26b5e79..fdfae532d717 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -958,10 +958,11 @@
#define SID_SW_ATTR_FILL_GRADIENT ( SID_SVX_START + 1139 )
#define SID_ATTR_BORDER_STYLES ( SID_SVX_START + 1140 )
+#define SID_ATTR_BORDER_DEFAULT_WIDTH ( SID_SVX_START + 1141 )
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE (SID_ATTR_BORDER_STYLES + 1)
+#define SID_SVX_FIRSTFREE (SID_ATTR_BORDER_DEFAULT_WIDTH + 1)
// Overflow check for slot IDs
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 57abb07c31a5..7bd88aca8b14 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -25,6 +25,7 @@
#include <svx/numinf.hxx>
#include <svl/srchitem.hxx>
#include <svl/ilstitem.hxx>
+#include <svl/int64item.hxx>
#include <svx/zoomslideritem.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/viewfrm.hxx>
@@ -480,6 +481,8 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
boost::scoped_ptr<SfxItemSet> pOldSet(new SfxItemSet(pOldAttrs->GetItemSet()));
boost::scoped_ptr<SvxNumberInfoItem> pNumberInfoItem;
+ pOldSet->MergeRange(SID_ATTR_BORDER_STYLES, SID_ATTR_BORDER_DEFAULT_WIDTH);
+
// We only allow these border line types.
std::vector<sal_Int32> aBorderStyles;
aBorderStyles.reserve(5);
@@ -490,9 +493,12 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
aBorderStyles.push_back(table::BorderLineStyle::DOUBLE);
SfxIntegerListItem aBorderStylesItem(SID_ATTR_BORDER_STYLES, aBorderStyles);
- pOldSet->MergeRange(SID_ATTR_BORDER_STYLES, SID_ATTR_BORDER_STYLES);
pOldSet->Put(aBorderStylesItem);
+ // Set the default border width to 0.75 points.
+ SfxInt64Item aBorderWidthItem(SID_ATTR_BORDER_DEFAULT_WIDTH, 75);
+ pOldSet->Put(aBorderWidthItem);
+
// Get border items and put them in the set:
GetSelectionFrame( aLineOuter, aLineInner );
//Fix border incorrect for RTL fdo#62399
diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
index 37325614de3c..ba4d9b9b6121 100644
--- a/svl/Library_svl.mk
+++ b/svl/Library_svl.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_Library_add_exception_objects,svl,\
svl/source/items/ilstitem \
svl/source/items/imageitm \
svl/source/items/intitem \
+ svl/source/items/int64item \
svl/source/items/itemiter \
svl/source/items/itempool \
svl/source/items/itemprop \
diff --git a/svl/source/items/int64item.cxx b/svl/source/items/int64item.cxx
new file mode 100644
index 000000000000..34556b28e235
--- /dev/null
+++ b/svl/source/items/int64item.cxx
@@ -0,0 +1,109 @@
+/* -*- 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/.
+ */
+
+#include <svl/int64item.hxx>
+#include <tools/stream.hxx>
+
+SfxInt64Item::SfxInt64Item( sal_uInt16 nWhich, sal_Int64 nVal ) :
+ SfxPoolItem(nWhich), mnValue(nVal)
+{
+}
+
+SfxInt64Item::SfxInt64Item( sal_uInt16 nWhich, SvStream& rStream ) :
+ SfxPoolItem(nWhich)
+{
+ rStream.ReadInt64(mnValue);
+}
+
+SfxInt64Item::SfxInt64Item( const SfxInt64Item& rItem ) :
+ SfxPoolItem(rItem), mnValue(rItem.mnValue)
+{
+}
+
+SfxInt64Item::~SfxInt64Item() {}
+
+bool SfxInt64Item::operator== ( const SfxPoolItem& rItem ) const
+{
+ return mnValue == static_cast<const SfxInt64Item&>(rItem).mnValue;
+}
+
+int SfxInt64Item::Compare( const SfxPoolItem& r ) const
+{
+ sal_Int64 nOther = static_cast<const SfxInt64Item&>(r).mnValue;
+
+ if (mnValue < nOther)
+ return -1;
+
+ if (mnValue > nOther)
+ return 1;
+
+ return 0;
+}
+
+int SfxInt64Item::Compare( const SfxPoolItem& r, const IntlWrapper& /*rIntlWrapper*/ ) const
+{
+ return Compare(r);
+}
+
+SfxItemPresentation SfxInt64Item::GetPresentation(
+ SfxItemPresentation, SfxMapUnit, SfxMapUnit, OUString& rText,
+ const IntlWrapper* /*pIntlWrapper*/ ) const
+{
+ rText = OUString::number(mnValue);
+ return SFX_ITEM_PRESENTATION_NAMELESS;
+}
+
+bool SfxInt64Item::QueryValue(
+ com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
+{
+ rVal <<= mnValue;
+ return true;
+}
+
+bool SfxInt64Item::PutValue(
+ const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
+{
+ sal_Int64 nVal;
+
+ if (rVal >>= nVal)
+ {
+ mnValue = nVal;
+ return true;
+ }
+
+ return false;
+}
+
+SfxPoolItem* SfxInt64Item::Create( SvStream& rStream, sal_uInt16 /*nItemVersion*/ ) const
+{
+ return new SfxInt64Item(Which(), rStream);
+}
+
+SvStream& SfxInt64Item::Store( SvStream& rStream, sal_uInt16 /*nItemVersion*/ ) const
+{
+ return rStream.WriteInt64(mnValue);
+}
+
+SfxPoolItem* SfxInt64Item::Clone( SfxItemPool* /*pOther*/ ) const
+{
+ return new SfxInt64Item(*this);
+}
+
+sal_Int64 SfxInt64Item::GetValue() const
+{
+ return mnValue;
+}
+
+void SfxInt64Item::SetValue( sal_Int64 nVal )
+{
+ mnValue = nVal;
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */