Resolves: tdf#92051 add tooltips to section/table statusbar
Change-Id: I649eabbe266085fdbc0ca9c4a5506c0c2a270721 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144199 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
46
include/svx/statusitem.hxx
Normal file
46
include/svx/statusitem.hxx
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
||||||
|
/*
|
||||||
|
* 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/.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <svl/stritem.hxx>
|
||||||
|
#include <svx/svxdllapi.h>
|
||||||
|
|
||||||
|
enum class StatusCategory : sal_Int16
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
TableCell,
|
||||||
|
Section,
|
||||||
|
TableOfContents,
|
||||||
|
Numbering,
|
||||||
|
ListStyle,
|
||||||
|
Formula,
|
||||||
|
RowColumn
|
||||||
|
};
|
||||||
|
|
||||||
|
class SVX_DLLPUBLIC SvxStatusItem final : public SfxStringItem
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
StatusCategory m_eCategory;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SvxStatusItem(TypedWhichId<SvxStatusItem> nWhich, const OUString& rString,
|
||||||
|
StatusCategory eStatusCategory);
|
||||||
|
|
||||||
|
StatusCategory GetCategory() const { return m_eCategory; }
|
||||||
|
|
||||||
|
virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
|
||||||
|
virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
|
||||||
|
|
||||||
|
virtual bool operator==(const SfxPoolItem& rItem) const override;
|
||||||
|
virtual SvxStatusItem* Clone(SfxItemPool* pPool = nullptr) const override;
|
||||||
|
|
||||||
|
static SfxPoolItem* CreateDefault();
|
||||||
|
};
|
||||||
|
|
||||||
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
@@ -1326,6 +1326,13 @@
|
|||||||
#define RID_SVXSTR_DOC_LOAD NC_("RID_SVXSTR_DOC_LOAD", "Loading document...")
|
#define RID_SVXSTR_DOC_LOAD NC_("RID_SVXSTR_DOC_LOAD", "Loading document...")
|
||||||
#define RID_SVXSTR_FIT_SLIDE NC_("RID_SVXSTR_FIT_SLIDE", "Fit slide to current window.")
|
#define RID_SVXSTR_FIT_SLIDE NC_("RID_SVXSTR_FIT_SLIDE", "Fit slide to current window.")
|
||||||
#define RID_SVXSTR_WARN_MISSING_SMARTART NC_("RID_SVXSTR_WARN_MISSING_SMARTART", "Could not load all SmartArt objects. Saving in Microsoft Office 2010 or later would avoid this issue.")
|
#define RID_SVXSTR_WARN_MISSING_SMARTART NC_("RID_SVXSTR_WARN_MISSING_SMARTART", "Could not load all SmartArt objects. Saving in Microsoft Office 2010 or later would avoid this issue.")
|
||||||
|
#define RID_SVXSTR_TABLECELL_HINT NC_("RID_SVXSTR_TABLECELL_HINT", "Table cell address. Click to open Table Properties dialog.")
|
||||||
|
#define RID_SVXSTR_SECTION_HINT NC_("RID_SVXSTR_SECTION_HINT", "Section name. Click to open Edit Sections dialog.")
|
||||||
|
#define RID_SVXSTR_TOC_HINT NC_("RID_SVXSTR_TOC_HINT", "Table of Contents. Click to open Table of Contents dialog.")
|
||||||
|
#define RID_SVXSTR_NUMBERING_HINT NC_("RID_SVXSTR_NUMBERING_HINT", "Numbering Level. Click to open Numbering dialog.")
|
||||||
|
#define RID_SVXSTR_LIST_STYLE_HINT NC_("RID_SVXSTR_LIST_STYLE_HINT", "List Style and Level.")
|
||||||
|
#define RID_SVXSTR_FORMULA_HINT NC_("RID_SVXSTR_FORMULA_HINT", "Formula")
|
||||||
|
#define RID_SVXSTR_ROW_COLUMN_HINT NC_("RID_SVXSTR_ROW_COLUMN_HINT", "Row and Column")
|
||||||
#define RID_SVXSTR_ZOOMTOOL_HINT NC_("RID_SVXSTR_ZOOMTOOL_HINT", "Zoom factor. Right-click to change zoom factor or click to open Zoom dialog.")
|
#define RID_SVXSTR_ZOOMTOOL_HINT NC_("RID_SVXSTR_ZOOMTOOL_HINT", "Zoom factor. Right-click to change zoom factor or click to open Zoom dialog.")
|
||||||
#define RID_SVXSTR_ZOOM_IN NC_("RID_SVXSTR_ZOOM_IN", "Zoom In")
|
#define RID_SVXSTR_ZOOM_IN NC_("RID_SVXSTR_ZOOM_IN", "Zoom In")
|
||||||
#define RID_SVXSTR_ZOOM_OUT NC_("RID_SVXSTR_ZOOM_OUT", "Zoom Out")
|
#define RID_SVXSTR_ZOOM_OUT NC_("RID_SVXSTR_ZOOM_OUT", "Zoom Out")
|
||||||
|
@@ -63,6 +63,7 @@ class SvxPostItTextItem;
|
|||||||
class SvxRulerItem;
|
class SvxRulerItem;
|
||||||
class SvxSetItem;
|
class SvxSetItem;
|
||||||
class SvxSizeItem;
|
class SvxSizeItem;
|
||||||
|
class SvxStatusItem;
|
||||||
class SvxSmartTagItem;
|
class SvxSmartTagItem;
|
||||||
class SvxViewLayoutItem;
|
class SvxViewLayoutItem;
|
||||||
class SvxZoomSliderItem;
|
class SvxZoomSliderItem;
|
||||||
@@ -355,7 +356,7 @@ class XFillGradientItem;
|
|||||||
#define SID_ATTR_ZOOM_USER TypedWhichId<SfxUInt16Item>( SID_SVX_START + 222 )
|
#define SID_ATTR_ZOOM_USER TypedWhichId<SfxUInt16Item>( SID_SVX_START + 222 )
|
||||||
#define SID_ATTR_POSITION TypedWhichId<SfxPointItem>( SID_SVX_START + 223 )
|
#define SID_ATTR_POSITION TypedWhichId<SfxPointItem>( SID_SVX_START + 223 )
|
||||||
#define SID_ATTR_SIZE TypedWhichId<SvxSizeItem>( SID_SVX_START + 224 )
|
#define SID_ATTR_SIZE TypedWhichId<SvxSizeItem>( SID_SVX_START + 224 )
|
||||||
#define SID_TABLE_CELL ( SID_SVX_START + 225 )
|
#define SID_TABLE_CELL TypedWhichId<SvxStatusItem>( SID_SVX_START + 225 )
|
||||||
#define SID_ATTR_ALIGN_MARGIN ( SID_SVX_START + 228 )
|
#define SID_ATTR_ALIGN_MARGIN ( SID_SVX_START + 228 )
|
||||||
#define SID_ATTR_ALIGN_STACKED ( SID_SVX_START + 229 )
|
#define SID_ATTR_ALIGN_STACKED ( SID_SVX_START + 229 )
|
||||||
#define SID_ATTR_ALIGN_LINEBREAK ( SID_SVX_START + 230 )
|
#define SID_ATTR_ALIGN_LINEBREAK ( SID_SVX_START + 230 )
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#include <svx/hlnkitem.hxx>
|
#include <svx/hlnkitem.hxx>
|
||||||
#include <svl/srchitem.hxx>
|
#include <svl/srchitem.hxx>
|
||||||
#include <svx/postattr.hxx>
|
#include <svx/postattr.hxx>
|
||||||
|
#include <svx/statusitem.hxx>
|
||||||
#include <editeng/postitem.hxx>
|
#include <editeng/postitem.hxx>
|
||||||
#include <sfx2/tplpitem.hxx>
|
#include <sfx2/tplpitem.hxx>
|
||||||
#include <sfx2/zoomitem.hxx>
|
#include <sfx2/zoomitem.hxx>
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include <vcl/EnumContext.hxx>
|
#include <vcl/EnumContext.hxx>
|
||||||
#include <vcl/svapp.hxx>
|
#include <vcl/svapp.hxx>
|
||||||
#include <svx/clipfmtitem.hxx>
|
#include <svx/clipfmtitem.hxx>
|
||||||
|
#include <svx/statusitem.hxx>
|
||||||
|
|
||||||
#include <cellsh.hxx>
|
#include <cellsh.hxx>
|
||||||
#include <sc.hrc>
|
#include <sc.hrc>
|
||||||
@@ -874,7 +875,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
|
|||||||
|
|
||||||
// calculations etc. with date/time/Fail/position&size together
|
// calculations etc. with date/time/Fail/position&size together
|
||||||
|
|
||||||
// #i34458# The SfxStringItem belongs only into SID_TABLE_CELL. It no longer has to be
|
// #i34458# The SvxStatusItem belongs only into SID_TABLE_CELL. It no longer has to be
|
||||||
// duplicated in SID_ATTR_POSITION or SID_ATTR_SIZE for SvxPosSizeStatusBarControl.
|
// duplicated in SID_ATTR_POSITION or SID_ATTR_SIZE for SvxPosSizeStatusBarControl.
|
||||||
case SID_TABLE_CELL:
|
case SID_TABLE_CELL:
|
||||||
{
|
{
|
||||||
@@ -883,7 +884,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
|
|||||||
|
|
||||||
// In interpreter may happen via rescheduled Basic
|
// In interpreter may happen via rescheduled Basic
|
||||||
if ( rDoc.IsInInterpreter() )
|
if ( rDoc.IsInInterpreter() )
|
||||||
rSet.Put( SfxStringItem( nWhich, "..." ) );
|
rSet.Put( SvxStatusItem( SID_TABLE_CELL, "...", StatusCategory::Formula ) );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FormulaError nErrCode = FormulaError::NONE;
|
FormulaError nErrCode = FormulaError::NONE;
|
||||||
@@ -893,7 +894,9 @@ void ScCellShell::GetState(SfxItemSet &rSet)
|
|||||||
|
|
||||||
OUString aFuncStr;
|
OUString aFuncStr;
|
||||||
if ( pTabViewShell->GetFunction( aFuncStr, nErrCode ) )
|
if ( pTabViewShell->GetFunction( aFuncStr, nErrCode ) )
|
||||||
rSet.Put( SfxStringItem( nWhich, aFuncStr ) );
|
{
|
||||||
|
rSet.Put( SvxStatusItem( SID_TABLE_CELL, aFuncStr, StatusCategory::Formula ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -109,6 +109,13 @@
|
|||||||
item SfxScriptOrganizer SfxScriptOrganizerItem;
|
item SfxScriptOrganizer SfxScriptOrganizerItem;
|
||||||
item String SvxClipboardFormatItem; //! Dummy
|
item String SvxClipboardFormatItem; //! Dummy
|
||||||
|
|
||||||
|
struct Status
|
||||||
|
{
|
||||||
|
String Value MID_VALUE;
|
||||||
|
INT16 Status MID_TYPE;
|
||||||
|
};
|
||||||
|
item Status SvxStatusItem;
|
||||||
|
|
||||||
struct SvxZoom
|
struct SvxZoom
|
||||||
{
|
{
|
||||||
UINT16 Value MID_VALUE;
|
UINT16 Value MID_VALUE;
|
||||||
|
@@ -22,11 +22,12 @@
|
|||||||
#include <tools/debug.hxx>
|
#include <tools/debug.hxx>
|
||||||
#include <svl/eitem.hxx>
|
#include <svl/eitem.hxx>
|
||||||
#include <svl/intitem.hxx>
|
#include <svl/intitem.hxx>
|
||||||
|
#include <svl/itempool.hxx>
|
||||||
#include <svl/itemset.hxx>
|
#include <svl/itemset.hxx>
|
||||||
|
#include <svl/stritem.hxx>
|
||||||
#include <svl/visitem.hxx>
|
#include <svl/visitem.hxx>
|
||||||
#include <svtools/javacontext.hxx>
|
#include <svtools/javacontext.hxx>
|
||||||
#include <svtools/javainteractionhandler.hxx>
|
#include <svtools/javainteractionhandler.hxx>
|
||||||
#include <svl/itempool.hxx>
|
|
||||||
#include <tools/urlobj.hxx>
|
#include <tools/urlobj.hxx>
|
||||||
#include <com/sun/star/awt/FontDescriptor.hpp>
|
#include <com/sun/star/awt/FontDescriptor.hpp>
|
||||||
#include <com/sun/star/awt/Point.hpp>
|
#include <com/sun/star/awt/Point.hpp>
|
||||||
@@ -1167,7 +1168,6 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra
|
|||||||
else if (aEvent.FeatureURL.Path == "StatusDocPos" ||
|
else if (aEvent.FeatureURL.Path == "StatusDocPos" ||
|
||||||
aEvent.FeatureURL.Path == "RowColSelCount" ||
|
aEvent.FeatureURL.Path == "RowColSelCount" ||
|
||||||
aEvent.FeatureURL.Path == "StatusPageStyle" ||
|
aEvent.FeatureURL.Path == "StatusPageStyle" ||
|
||||||
aEvent.FeatureURL.Path == "StateTableCell" ||
|
|
||||||
aEvent.FeatureURL.Path == "StateWordCount" ||
|
aEvent.FeatureURL.Path == "StateWordCount" ||
|
||||||
aEvent.FeatureURL.Path == "PageStyleName" ||
|
aEvent.FeatureURL.Path == "PageStyleName" ||
|
||||||
aEvent.FeatureURL.Path == "PageStatus" ||
|
aEvent.FeatureURL.Path == "PageStatus" ||
|
||||||
@@ -1182,6 +1182,14 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra
|
|||||||
aBuffer.append(aString);
|
aBuffer.append(aString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (aEvent.FeatureURL.Path == "StateTableCell")
|
||||||
|
{
|
||||||
|
if (aEvent.IsEnabled)
|
||||||
|
{
|
||||||
|
if (const SfxStringItem* pSvxStatusItem = dynamic_cast<const SfxStringItem*>(pState))
|
||||||
|
aBuffer.append(pSvxStatusItem->GetValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (aEvent.FeatureURL.Path == "InsertMode" ||
|
else if (aEvent.FeatureURL.Path == "InsertMode" ||
|
||||||
aEvent.FeatureURL.Path == "WrapText" ||
|
aEvent.FeatureURL.Path == "WrapText" ||
|
||||||
aEvent.FeatureURL.Path == "NumberFormatCurrency" ||
|
aEvent.FeatureURL.Path == "NumberFormatCurrency" ||
|
||||||
|
@@ -200,6 +200,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
|
|||||||
svx/source/items/postattr \
|
svx/source/items/postattr \
|
||||||
svx/source/items/rotmodit \
|
svx/source/items/rotmodit \
|
||||||
svx/source/items/SmartTagItem \
|
svx/source/items/SmartTagItem \
|
||||||
|
svx/source/items/statusitem \
|
||||||
svx/source/items/svxerr \
|
svx/source/items/svxerr \
|
||||||
svx/source/items/viewlayoutitem \
|
svx/source/items/viewlayoutitem \
|
||||||
svx/source/items/zoomslideritem \
|
svx/source/items/zoomslideritem \
|
||||||
|
@@ -10378,7 +10378,7 @@ SfxVoidItem DecrementIndent SID_DEC_INDENT
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
SfxStringItem StateTableCell SID_TABLE_CELL
|
SvxStatusItem StateTableCell SID_TABLE_CELL
|
||||||
|
|
||||||
[
|
[
|
||||||
AutoUpdate = FALSE,
|
AutoUpdate = FALSE,
|
||||||
|
134
svx/source/items/statusitem.cxx
Normal file
134
svx/source/items/statusitem.cxx
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
||||||
|
/*
|
||||||
|
* 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 <com/sun/star/uno/Sequence.hxx>
|
||||||
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||||
|
#include <comphelper/propertyvalue.hxx>
|
||||||
|
#include <svl/memberid.h>
|
||||||
|
#include <svx/statusitem.hxx>
|
||||||
|
|
||||||
|
constexpr OUStringLiteral STATUS_PARAM_VALUE = u"Value";
|
||||||
|
constexpr OUStringLiteral STATUS_PARAM_TYPE = u"Type";
|
||||||
|
constexpr int STATUS_PARAMS = 2;
|
||||||
|
|
||||||
|
SvxStatusItem::SvxStatusItem(TypedWhichId<SvxStatusItem> nWhich, const OUString& rString,
|
||||||
|
StatusCategory eCategory)
|
||||||
|
: SfxStringItem(nWhich, rString)
|
||||||
|
, m_eCategory(eCategory)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SvxStatusItem::operator==(const SfxPoolItem& rItem) const
|
||||||
|
{
|
||||||
|
return SfxStringItem::operator==(rItem)
|
||||||
|
&& static_cast<const SvxStatusItem&>(rItem).m_eCategory == m_eCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SvxStatusItem::QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId) const
|
||||||
|
{
|
||||||
|
nMemberId &= ~CONVERT_TWIPS;
|
||||||
|
|
||||||
|
switch (nMemberId)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
css::uno::Sequence<css::beans::PropertyValue> aSeq{
|
||||||
|
comphelper::makePropertyValue(STATUS_PARAM_VALUE, GetValue()),
|
||||||
|
comphelper::makePropertyValue(STATUS_PARAM_TYPE,
|
||||||
|
static_cast<sal_Int16>(m_eCategory))
|
||||||
|
};
|
||||||
|
assert(aSeq.getLength() == STATUS_PARAMS);
|
||||||
|
rVal <<= aSeq;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case MID_VALUE:
|
||||||
|
rVal <<= GetValue();
|
||||||
|
break;
|
||||||
|
case MID_TYPE:
|
||||||
|
rVal <<= static_cast<sal_Int16>(m_eCategory);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SvxStatusItem::PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId)
|
||||||
|
{
|
||||||
|
nMemberId &= ~CONVERT_TWIPS;
|
||||||
|
bool bRet;
|
||||||
|
switch (nMemberId)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
css::uno::Sequence<css::beans::PropertyValue> aSeq;
|
||||||
|
if ((rVal >>= aSeq) && (aSeq.getLength() == STATUS_PARAMS))
|
||||||
|
{
|
||||||
|
OUString sValueTmp;
|
||||||
|
sal_Int16 nTypeTmp(0);
|
||||||
|
bool bAllConverted(true);
|
||||||
|
sal_Int16 nConvertedCount(0);
|
||||||
|
for (const auto& rProp : std::as_const(aSeq))
|
||||||
|
{
|
||||||
|
if (rProp.Name == STATUS_PARAM_VALUE)
|
||||||
|
{
|
||||||
|
bAllConverted &= (rProp.Value >>= sValueTmp);
|
||||||
|
++nConvertedCount;
|
||||||
|
}
|
||||||
|
else if (rProp.Name == STATUS_PARAM_TYPE)
|
||||||
|
{
|
||||||
|
bAllConverted &= (rProp.Value >>= nTypeTmp);
|
||||||
|
++nConvertedCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bAllConverted && nConvertedCount == STATUS_PARAMS)
|
||||||
|
{
|
||||||
|
SetValue(sValueTmp);
|
||||||
|
m_eCategory = static_cast<StatusCategory>(nTypeTmp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
case MID_TYPE:
|
||||||
|
{
|
||||||
|
sal_Int16 nCategory;
|
||||||
|
bRet = (rVal >>= nCategory);
|
||||||
|
if (bRet)
|
||||||
|
m_eCategory = static_cast<StatusCategory>(nCategory);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case MID_VALUE:
|
||||||
|
{
|
||||||
|
OUString aStr;
|
||||||
|
bRet = (rVal >>= aStr);
|
||||||
|
if (bRet)
|
||||||
|
SetValue(aStr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
SvxStatusItem* SvxStatusItem::Clone(SfxItemPool* /*pPool*/) const
|
||||||
|
{
|
||||||
|
return new SvxStatusItem(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
SfxPoolItem* SvxStatusItem::CreateDefault()
|
||||||
|
{
|
||||||
|
return new SvxStatusItem(TypedWhichId<SvxStatusItem>(0), OUString(), StatusCategory::NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
@@ -32,6 +32,9 @@
|
|||||||
#include <svl/stritem.hxx>
|
#include <svl/stritem.hxx>
|
||||||
#include <svl/ptitem.hxx>
|
#include <svl/ptitem.hxx>
|
||||||
#include <sfx2/module.hxx>
|
#include <sfx2/module.hxx>
|
||||||
|
#include <svx/dialmgr.hxx>
|
||||||
|
#include <svx/statusitem.hxx>
|
||||||
|
#include <svx/strings.hrc>
|
||||||
#include <svl/intitem.hxx>
|
#include <svl/intitem.hxx>
|
||||||
#include <sal/log.hxx>
|
#include <sal/log.hxx>
|
||||||
|
|
||||||
@@ -321,8 +324,48 @@ void SvxPosSizeStatusBarControl::StateChangedAtStatusBarControl( sal_uInt16 nSID
|
|||||||
pImpl->bSize = true;
|
pImpl->bSize = true;
|
||||||
pImpl->bTable = false;
|
pImpl->bTable = false;
|
||||||
}
|
}
|
||||||
|
else if ( auto pStatusItem = dynamic_cast<const SvxStatusItem*>( pState) )
|
||||||
|
{
|
||||||
|
// show string (table cell or different)
|
||||||
|
pImpl->aStr = pStatusItem->GetValue();
|
||||||
|
pImpl->bTable = true;
|
||||||
|
pImpl->bPos = false;
|
||||||
|
pImpl->bSize = false;
|
||||||
|
if (!pImpl->aStr.isEmpty())
|
||||||
|
{
|
||||||
|
OUString sTip;
|
||||||
|
switch (pStatusItem->GetCategory())
|
||||||
|
{
|
||||||
|
case StatusCategory::TableCell:
|
||||||
|
sTip = SvxResId(RID_SVXSTR_TABLECELL_HINT);
|
||||||
|
break;
|
||||||
|
case StatusCategory::Section:
|
||||||
|
sTip = SvxResId(RID_SVXSTR_SECTION_HINT);
|
||||||
|
break;
|
||||||
|
case StatusCategory::TableOfContents:
|
||||||
|
sTip = SvxResId(RID_SVXSTR_TOC_HINT);
|
||||||
|
break;
|
||||||
|
case StatusCategory::Numbering:
|
||||||
|
sTip = SvxResId(RID_SVXSTR_NUMBERING_HINT);
|
||||||
|
break;
|
||||||
|
case StatusCategory::ListStyle:
|
||||||
|
sTip = SvxResId(RID_SVXSTR_LIST_STYLE_HINT);
|
||||||
|
break;
|
||||||
|
case StatusCategory::Formula:
|
||||||
|
sTip = SvxResId(RID_SVXSTR_FORMULA_HINT);
|
||||||
|
break;
|
||||||
|
case StatusCategory::RowColumn:
|
||||||
|
sTip = SvxResId(RID_SVXSTR_ROW_COLUMN_HINT);
|
||||||
|
break;
|
||||||
|
case StatusCategory::NONE:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
GetStatusBar().SetQuickHelpText(GetId(), sTip);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if ( auto pStringItem = dynamic_cast<const SfxStringItem*>( pState) )
|
else if ( auto pStringItem = dynamic_cast<const SfxStringItem*>( pState) )
|
||||||
{
|
{
|
||||||
|
SAL_WARN( "svx.stbcrtls", "this should be a SvxStatusItem not a SfxStringItem" );
|
||||||
// show string (table cell or different)
|
// show string (table cell or different)
|
||||||
pImpl->aStr = pStringItem->GetValue();
|
pImpl->aStr = pStringItem->GetValue();
|
||||||
pImpl->bTable = true;
|
pImpl->bTable = true;
|
||||||
|
@@ -55,6 +55,7 @@
|
|||||||
#include <svl/ptitem.hxx>
|
#include <svl/ptitem.hxx>
|
||||||
#include <editeng/sizeitem.hxx>
|
#include <editeng/sizeitem.hxx>
|
||||||
#include <editeng/langitem.hxx>
|
#include <editeng/langitem.hxx>
|
||||||
|
#include <svx/statusitem.hxx>
|
||||||
#include <svx/svdview.hxx>
|
#include <svx/svdview.hxx>
|
||||||
#include <svx/svdhdl.hxx>
|
#include <svx/svdhdl.hxx>
|
||||||
#include <svx/svdoutl.hxx>
|
#include <svx/svdoutl.hxx>
|
||||||
@@ -4204,7 +4205,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
|
|||||||
rBnd.Invalidate(SID_ATTR_POSITION);
|
rBnd.Invalidate(SID_ATTR_POSITION);
|
||||||
}
|
}
|
||||||
rBnd.Invalidate(SID_ATTR_SIZE);
|
rBnd.Invalidate(SID_ATTR_SIZE);
|
||||||
const SfxStringItem aCell( SID_TABLE_CELL, OUString() );
|
const SvxStatusItem aCell( SID_TABLE_CELL, OUString(), StatusCategory::NONE );
|
||||||
rBnd.SetState( aCell );
|
rBnd.SetState( aCell );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
#include <sfx2/objitem.hxx>
|
#include <sfx2/objitem.hxx>
|
||||||
#include <sfx2/objsh.hxx>
|
#include <sfx2/objsh.hxx>
|
||||||
#include <svx/rulritem.hxx>
|
#include <svx/rulritem.hxx>
|
||||||
|
#include <svx/statusitem.hxx>
|
||||||
#include <sfx2/zoomitem.hxx>
|
#include <sfx2/zoomitem.hxx>
|
||||||
#include <svx/viewlayoutitem.hxx>
|
#include <svx/viewlayoutitem.hxx>
|
||||||
#include <svx/zoomslideritem.hxx>
|
#include <svx/zoomslideritem.hxx>
|
||||||
|
@@ -45,6 +45,7 @@
|
|||||||
#include <sfx2/request.hxx>
|
#include <sfx2/request.hxx>
|
||||||
#include <sfx2/docfile.hxx>
|
#include <sfx2/docfile.hxx>
|
||||||
#include <svx/srchdlg.hxx>
|
#include <svx/srchdlg.hxx>
|
||||||
|
#include <svx/statusitem.hxx>
|
||||||
#include <svl/srchitem.hxx>
|
#include <svl/srchitem.hxx>
|
||||||
#include <sfx2/sfxhtml.hxx>
|
#include <sfx2/sfxhtml.hxx>
|
||||||
#include <swtypes.hxx>
|
#include <swtypes.hxx>
|
||||||
@@ -426,7 +427,7 @@ void SwSrcView::GetState(SfxItemSet& rSet)
|
|||||||
aPos += " : " +
|
aPos += " : " +
|
||||||
SwResId(STR_SRCVIEW_COL);
|
SwResId(STR_SRCVIEW_COL);
|
||||||
aPos += OUString::number( aSel.GetEnd().GetIndex()+1 );
|
aPos += OUString::number( aSel.GetEnd().GetIndex()+1 );
|
||||||
SfxStringItem aItem( nWhich, aPos );
|
SvxStatusItem aItem( SID_TABLE_CELL, aPos, StatusCategory::RowColumn );
|
||||||
rSet.Put( aItem );
|
rSet.Put( aItem );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -46,9 +46,10 @@
|
|||||||
#include <sfx2/sfxdlg.hxx>
|
#include <sfx2/sfxdlg.hxx>
|
||||||
#include <sfx2/filedlghelper.hxx>
|
#include <sfx2/filedlghelper.hxx>
|
||||||
#include <editeng/langitem.hxx>
|
#include <editeng/langitem.hxx>
|
||||||
|
#include <svx/linkwarn.hxx>
|
||||||
|
#include <svx/statusitem.hxx>
|
||||||
#include <svx/viewlayoutitem.hxx>
|
#include <svx/viewlayoutitem.hxx>
|
||||||
#include <svx/zoomslideritem.hxx>
|
#include <svx/zoomslideritem.hxx>
|
||||||
#include <svx/linkwarn.hxx>
|
|
||||||
#include <sfx2/htmlmode.hxx>
|
#include <sfx2/htmlmode.hxx>
|
||||||
#include <vcl/svapp.hxx>
|
#include <vcl/svapp.hxx>
|
||||||
#include <sfx2/app.hxx>
|
#include <sfx2/app.hxx>
|
||||||
@@ -1963,12 +1964,14 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
StatusCategory eCategory(StatusCategory::NONE);
|
||||||
OUString sStr;
|
OUString sStr;
|
||||||
if( rShell.IsCursorInTable() )
|
if( rShell.IsCursorInTable() )
|
||||||
{
|
{
|
||||||
// table name + cell coordinate
|
// table name + cell coordinate
|
||||||
sStr = rShell.GetTableFormat()->GetName() + ":";
|
sStr = rShell.GetTableFormat()->GetName() + ":";
|
||||||
sStr += rShell.GetBoxNms();
|
sStr += rShell.GetBoxNms();
|
||||||
|
eCategory = StatusCategory::TableCell;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1982,17 +1985,22 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
|
|||||||
{
|
{
|
||||||
const SwTOXBase* pTOX = m_pWrtShell->GetCurTOX();
|
const SwTOXBase* pTOX = m_pWrtShell->GetCurTOX();
|
||||||
if( pTOX )
|
if( pTOX )
|
||||||
|
{
|
||||||
sStr = pTOX->GetTOXName();
|
sStr = pTOX->GetTOXName();
|
||||||
|
eCategory = StatusCategory::TableOfContents;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSL_ENSURE( false,
|
OSL_ENSURE( false,
|
||||||
"Unknown kind of section" );
|
"Unknown kind of section" );
|
||||||
sStr = pCurrSect->GetSectionName();
|
sStr = pCurrSect->GetSectionName();
|
||||||
|
eCategory = StatusCategory::Section;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sStr = pCurrSect->GetSectionName();
|
sStr = pCurrSect->GetSectionName();
|
||||||
|
eCategory = StatusCategory::Section;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2019,6 +2027,8 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
|
|||||||
{
|
{
|
||||||
if(!sStr.isEmpty())
|
if(!sStr.isEmpty())
|
||||||
sStr += sStatusDelim;
|
sStr += sStatusDelim;
|
||||||
|
if (eCategory == StatusCategory::NONE)
|
||||||
|
eCategory = StatusCategory::ListStyle;
|
||||||
sStr += rNumStyle;
|
sStr += rNumStyle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2026,7 +2036,8 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
|
|||||||
if (!sStr.isEmpty())
|
if (!sStr.isEmpty())
|
||||||
sStr += sStatusDelim;
|
sStr += sStatusDelim;
|
||||||
sStr += SwResId(STR_NUM_LEVEL) + OUString::number( nNumLevel + 1 );
|
sStr += SwResId(STR_NUM_LEVEL) + OUString::number( nNumLevel + 1 );
|
||||||
|
if (eCategory == StatusCategory::NONE)
|
||||||
|
eCategory = StatusCategory::Numbering;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const int nOutlineLevel = rShell.GetCurrentParaOutlineLevel();
|
const int nOutlineLevel = rShell.GetCurrentParaOutlineLevel();
|
||||||
@@ -2042,6 +2053,8 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
|
|||||||
else
|
else
|
||||||
sStr += SwResId(STR_NUM_OUTLINE);
|
sStr += SwResId(STR_NUM_OUTLINE);
|
||||||
sStr += OUString::number( nOutlineLevel);
|
sStr += OUString::number( nOutlineLevel);
|
||||||
|
if (eCategory == StatusCategory::NONE)
|
||||||
|
eCategory = StatusCategory::Numbering;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( rShell.HasReadonlySel() )
|
if( rShell.HasReadonlySel() )
|
||||||
@@ -2051,7 +2064,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
|
|||||||
sStr = SwResId(SW_STR_READONLY) + sStr;
|
sStr = SwResId(SW_STR_READONLY) + sStr;
|
||||||
}
|
}
|
||||||
if (!sStr.isEmpty())
|
if (!sStr.isEmpty())
|
||||||
rSet.Put( SfxStringItem( SID_TABLE_CELL, sStr ));
|
rSet.Put( SvxStatusItem( SID_TABLE_CELL, sStr, eCategory ));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FN_STAT_SELMODE:
|
case FN_STAT_SELMODE:
|
||||||
|
Reference in New Issue
Block a user