31#include <document.hxx>
35#include <bitmaps.hlst>
44#include <com/sun/star/uno/Reference.hxx>
52 return static_cast<sal_Int32
>( floor( log10(
static_cast<double>(
SCNAV_MAXCOL(rLimits)))) ) + 1;
82 else if ( nColNo < 1 )
96 rStr = rStr.toAsciiUpperCase();
119 nColumn = NumToAlpha( rSheetLimits,
static_cast<SCCOL>(rStr.toInt32()), rStr );
131 OUString aStrCol = m_xEdCol->get_text();
133 if (!aStrCol.isEmpty())
142 nCol = AlphaToNum( rDoc, aStrCol );
154 SCROW nRow = m_xEdRow->get_value();
155 SCCOL nCol = m_xEdCol->get_value();
157 if ( (nCol > 0) && (nRow > 0) )
158 SetCurrentCell(nCol - 1, nRow - 1);
167 m_xEdCol->set_text(
aStr);
174 SCCOL nCol = m_xEdCol->get_value();
175 SCROW nRow = m_xEdRow->get_value();
177 if ( (nCol > 0) && (nRow > 0) )
178 SetCurrentCell(nCol - 1, nRow - 1);
187 OUString aDocName = rListBox.get_active_text();
188 m_xLbEntries->SelectDoc(aDocName);
194 if (rSelId ==
"contents" || rSelId ==
"scenarios")
199 if (rSelId ==
"scenarios")
213 SetListMode(eNewMode);
216 else if (rSelId ==
"dragmode")
217 m_xTbxCmd2->set_menu_item_active(
"dragmode", !m_xTbxCmd2->get_menu_item_active(
"dragmode"));
220 if (rSelId ==
"datarange")
222 else if (rSelId ==
"start")
224 else if (rSelId ==
"end")
226 else if (rSelId ==
"toggle")
228 m_xLbEntries->ToggleRoot();
236 if (!m_xTbxCmd2->get_menu_item_active(rCommand))
241 if (rCommand !=
"dragmode")
244 switch (GetDropMode())
247 m_xDragModeMenu->set_active(
"hyperlink",
true);
250 m_xDragModeMenu->set_active(
"link",
true);
253 m_xDragModeMenu->set_active(
"copy",
true);
260 if (rIdent ==
u"hyperlink")
262 else if (rIdent ==
u"link")
264 else if (rIdent ==
u"copy")
277 m_xTbxCmd2->set_item_sensitive(
"toggle",
false);
282 m_xTbxCmd2->set_item_sensitive(
"toggle",
true);
284 m_xTbxCmd2->set_item_active(
"toggle", bRootSet);
291 sImageId = RID_BMP_DROP_URL;
294 sImageId = RID_BMP_DROP_LINK;
297 sImageId = RID_BMP_DROP_COPY;
300 m_xTbxCmd2->set_item_icon_name(
"dragmode", sImageId);
338 :
PanelLayout(pParent,
"NavigatorPanel",
"modules/scalc/ui/navigatorpanel.ui")
340 , m_xEdCol(m_xBuilder->weld_spin_button(
"column"))
341 , m_xEdRow(m_xBuilder->weld_spin_button(
"row"))
342 , m_xTbxCmd1(m_xBuilder->weld_toolbar(
"toolbox1"))
343 , m_xTbxCmd2(m_xBuilder->weld_toolbar(
"toolbox2"))
344 , m_xLbEntries(new
ScContentTree(m_xBuilder->weld_tree_view(
"contentbox"), this))
345 , m_xScenarioBox(m_xBuilder->weld_widget(
"scenariobox"))
347 ScResId(SCSTR_QHLP_SCEN_LISTBOX),
ScResId(SCSTR_QHLP_SCEN_COMMENT)))
348 , m_xLbDocuments(m_xBuilder->weld_combo_box(
"documents"))
349 , m_xDragModeMenu(m_xBuilder->weld_menu(
"dragmodemenu"))
350 , m_xNavigatorDlg(pNavigatorDlg)
351 , aContentIdle(
"ScNavigatorDlg aContentIdle")
352 , aStrActiveWin(
ScResId(SCSTR_ACTIVEWIN))
353 , pViewData(nullptr )
422 m_xTbxCmd2->set_item_active(
"scenarios",
true);
429 m_xBuilder->weld_container(
"gridbuttons")->hide();
463 if (nStateChange == StateChangedType::InitShow)
493 if (pHint->GetEventId() == SfxEventHintId::ActivateDoc)
510 if (nHintId == SfxHintId::ScDocNameChanged)
522 case SfxHintId::ScTablesChanged:
526 case SfxHintId::ScDbAreasChanged:
530 case SfxHintId::ScAreasChanged:
534 case SfxHintId::ScDrawChanged:
540 case SfxHintId::ScAreaLinksChanged:
546 case SfxHintId::ScNavigatorUpdateAll:
550 case SfxHintId::ScDataChanged:
551 case SfxHintId::ScAnyDataChanged:
554 case SfxHintId::ScSelectionChanged:
566 if ( pIdle != &aContentIdle )
589 ScAddress aScAddress( nColNo, nRowNo, 0 );
592 bool bUnmark =
false;
600 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
601 { &aPosItem, &aUnmarkItem });
610 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
619 SfxUInt16Item aTabItem( SID_CURRENTTAB,
static_cast<sal_uInt16
>(nTabNo) + 1 );
621 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
633 SCTAB nLastSheet = 0;
638 if (aTabName == rName)
665 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
673 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
687 uno::Reference< container::XIndexAccess > xIndexAccess(
688 xShapes, uno::UNO_QUERY_THROW );
689 if( xIndexAccess->getCount() > 1 )
691 uno::Reference< drawing::XShape > xShape;
692 if( xIndexAccess->getByIndex(0) >>= xShape )
694 uno::Reference< container::XNamed > xNamed( xShape, uno::UNO_QUERY_THROW );
695 OUString
sName = xNamed->getName();
696 if (!
sName.isEmpty())
811 pNav->InvalidateChildSizeCache();
812 Size aOptimalSize(pNav->GetOptimalSize());
813 Size aNewSize(pNav->GetOutputSizePixel());
816 pNav->SetOutputSizePixel(aNewSize);
861 if (
dynamic_cast<const ScDocShell*
>( pSh) !=
nullptr )
864 OUString aEntry =
aName;
865 if (pSh == pCurrentSh)
871 if ( pManualSel ? (
aName == *pManualSel )
872 : ( pSh == pCurrentSh ) )
882 if (!aHidden.isEmpty())
887 if ( pManualSel && aHidden == *pManualSel )
938 if ( (nCol+1 !=
m_xEdCol->get_value()) || (nRow+1 !=
m_xEdRow->get_value()) )
955 if ( (nCol+1 !=
m_xEdCol->get_value()) || (nRow+1 !=
m_xEdRow->get_value()) )
void ScColToAlpha(OUStringBuffer &rBuf, SCCOL nCol)
append alpha representation of column to buffer
bool AlphaToCol(const ScDocument &rDoc, SCCOL &rCol, std::u16string_view rStr)
get column number of A..IV... string
SfxApplication * SfxGetpApp()
SFX2_DLLPUBLIC bool ParentIsFloatingWindow(const vcl::Window *pParent)
static bool isAsciiNumeric(std::u16string_view rStr)
static bool isAsciiAlpha(std::u16string_view rStr)
virtual void Start(bool bStartTimer=true) override
virtual weld::Window * GetFrameWeld() const
std::unique_ptr< weld::Builder > m_xBuilder
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
ScSheetLimits & GetSheetLimits() const
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
SC_DLLPUBLIC SCTAB GetTableCount() const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
const ScRange & GetMarkArea() const
bool IsCellMarked(SCCOL nCol, SCROW nRow, bool bNoSimple=false) const
std::unique_ptr< weld::SpinButton > m_xEdRow
void SetCurrentCell(SCCOL nCol, SCROW Row)
std::unique_ptr< weld::Widget > m_xScenarioBox
void SetListMode(NavListMode eMode)
void UpdateColumn(const SCCOL *pCol=nullptr)
ScViewData * GetViewData()
VclPtr< SfxNavigator > m_xNavigatorDlg
virtual weld::Window * GetFrameWeld() const override
std::unique_ptr< ScContentTree > m_xLbEntries
void SetDropMode(sal_uInt16 nNew)
static ScNavigatorSettings * GetNavigatorSettings()
ScNavigatorDlg(SfxBindings *pB, weld::Widget *pParent, SfxNavigator *pNavigatorDlg)
std::unique_ptr< weld::ComboBox > m_xLbDocuments
static ScTabViewShell * GetTabViewShell()
std::unique_ptr< weld::SpinButton > m_xEdCol
friend class ScNavigatorControllerItem
std::optional< ScArea > moMarkArea
std::unique_ptr< weld::Toolbar > m_xTbxCmd1
void SetCurrentTable(SCTAB nTab)
void SetCurrentTableStr(std::u16string_view rName)
void SetCurrentCellStr(const OUString &rName)
void GetDocNames(const OUString *pSelEntry)
void SetCurrentObject(const OUString &rName)
void UpdateTable(const SCTAB *pTab)
void ShowList(bool bShow)
virtual ~ScNavigatorDlg() override
static void ReleaseFocus()
std::array< std::unique_ptr< ScNavigatorControllerItem >, CTRL_ITEMS > mvBoundItems
void SetCurrentDoc(const OUString &rDocName)
std::unique_ptr< weld::Menu > m_xDragModeMenu
void UpdateRow(const SCROW *pRow=nullptr)
std::unique_ptr< weld::Toolbar > m_xTbxCmd2
std::unique_ptr< ScScenarioWindow > m_xWndScenarios
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Contains settings of the navigator listbox.
ScNavigatorSettings()
Index of selected child entry.
o3tl::enumarray< ScContentId, bool > maExpandedVec
virtual void dispose() override
virtual void StateChanged(StateChangedType nStateChange) override
virtual ~ScNavigatorWin() override
ScNavigatorWin(SfxBindings *_pBindings, SfxChildWindow *pMgr, vcl::Window *pParent, SfxChildWinInfo *pInfo)
std::unique_ptr< ScNavigatorDlg > m_xNavigator
ScNavigatorWrapper(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
void SetListMode(sal_uInt16 nNew)
sal_uInt16 GetDragMode() const
void SetDragMode(sal_uInt16 nNew)
ScContentId GetRootType() const
sal_uInt16 GetListMode() const
ScNavigatorSettings * GetNavigatorSettings()
css::uno::Reference< css::drawing::XShapes > getSelectedXShapes()
void MarkDataArea(bool bIncludeCursor=true)
ScViewData & GetViewData()
ScMarkData & GetMarkData()
ScDocument & GetDocument() const
void Update(sal_uInt16 nId)
SfxDispatcher * GetDispatcher() const
void Invalidate(sal_uInt16 nId)
void SetWindow(const VclPtr< vcl::Window > &p)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
std::unique_ptr< weld::Box > m_xContainer
virtual void StateChanged(StateChangedType nStateChange) override
virtual void dispose() override
void SetMinOutputSizePixel(const Size &rSize)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
OUString GetTitle(sal_uInt16 nMaxLen=0) const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
vcl::Window * GetWindow() const
constexpr tools::Long Height() const
void setHeight(tools::Long nHeight)
void SetPriority(TaskPriority ePriority)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
reference_type * get() const
const sal_uLong SC_CONTENT_NOCHILD
#define LINK(Instance, Class, Member)
std::unique_ptr< sal_Int32[]> pData
IMPL_LINK_NOARG(ScNavigatorDlg, ExecuteColHdl, weld::Entry &, bool)
static SCCOL SCNAV_MAXCOL(const ScSheetLimits &rLimits)
SFX_IMPL_DOCKINGWINDOW(ScNavigatorWrapper, SID_NAVIGATOR)
static sal_Int32 SCNAV_COLLETTERS(const ScSheetLimits &rLimits)
static sal_Int32 SCNAV_COLDIGITS(const ScSheetLimits &rLimits)
IMPL_LINK(ScNavigatorDlg, ParseRowInputHdl, int *, result, bool)
static SCROW SCNAV_MAXROW(const ScSheetLimits &rSheetLimits)
OUString ScResId(TranslateId aId)
SCROW GetMaxRowCount() const
SCCOL GetMaxColCount() const