31 #include <document.hxx>
34 #include <strings.hrc>
35 #include <bitmaps.hlst>
38 #include <navicfg.hxx>
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 );
155 SCROW nRow = m_xEdRow->get_value();
156 SCCOL nCol = m_xEdCol->get_value();
158 if ( (nCol > 0) && (nRow > 0) )
159 SetCurrentCell(nCol - 1, nRow - 1);
168 m_xEdCol->set_text(aStr);
175 SCCOL nCol = m_xEdCol->get_value();
176 SCROW nRow = m_xEdRow->get_value();
178 if ( (nCol > 0) && (nRow > 0) )
179 SetCurrentCell(nCol - 1, nRow - 1);
188 OUString aDocName = rListBox.get_active_text();
189 m_xLbEntries->SelectDoc(aDocName);
195 if (rSelId ==
"contents" || rSelId ==
"scenarios")
200 if (rSelId ==
"scenarios")
214 SetListMode(eNewMode);
217 else if (rSelId ==
"dragmode")
218 m_xTbxCmd2->set_menu_item_active(
"dragmode", !m_xTbxCmd2->get_menu_item_active(
"dragmode"));
221 if (rSelId ==
"datarange")
223 else if (rSelId ==
"start")
225 else if (rSelId ==
"end")
227 else if (rSelId ==
"toggle")
229 m_xLbEntries->ToggleRoot();
237 if (!m_xTbxCmd2->get_menu_item_active(rCommand))
242 if (rCommand !=
"dragmode")
245 switch (GetDropMode())
248 m_xDragModeMenu->set_active(
"hyperlink",
true);
251 m_xDragModeMenu->set_active(
"link",
true);
254 m_xDragModeMenu->set_active(
"copy",
true);
261 if (rIdent ==
"hyperlink")
263 else if (rIdent ==
"link")
265 else if (rIdent ==
"copy")
278 m_xTbxCmd2->set_item_sensitive(
"toggle",
false);
279 m_xTbxCmd2->set_item_active(
"toggle",
false);
283 m_xTbxCmd2->set_item_sensitive(
"toggle",
true);
285 m_xTbxCmd2->set_item_active(
"toggle", bRootSet);
292 sImageId = RID_BMP_DROP_URL;
295 sImageId = RID_BMP_DROP_LINK;
298 sImageId = RID_BMP_DROP_COPY;
301 m_xTbxCmd2->set_item_icon_name(
"dragmode", sImageId);
321 m_xNavigator.reset();
339 :
PanelLayout(pParent,
"NavigatorPanel",
"modules/scalc/ui/navigatorpanel.ui")
341 , m_xEdCol(m_xBuilder->weld_spin_button(
"column"))
342 , m_xEdRow(m_xBuilder->weld_spin_button(
"row"))
343 , m_xTbxCmd1(m_xBuilder->weld_toolbar(
"toolbox1"))
344 , m_xTbxCmd2(m_xBuilder->weld_toolbar(
"toolbox2"))
345 , m_xLbEntries(new
ScContentTree(m_xBuilder->weld_tree_view(
"contentbox"), this))
346 , m_xScenarioBox(m_xBuilder->weld_widget(
"scenariobox"))
348 ScResId(SCSTR_QHLP_SCEN_LISTBOX),
ScResId(SCSTR_QHLP_SCEN_COMMENT)))
349 , m_xLbDocuments(m_xBuilder->weld_combo_box(
"documents"))
350 , m_xDragModeMenu(m_xBuilder->weld_menu(
"dragmodemenu"))
351 , m_xNavigatorDlg(pNavigatorDlg)
352 , aContentIdle(
"ScNavigatorDlg aContentIdle")
353 , aStrActiveWin(
ScResId(SCSTR_ACTIVEWIN))
354 , pViewData(nullptr )
423 m_xTbxCmd2->set_item_active(
"scenarios",
true);
458 if (nStateChange == StateChangedType::InitShow)
486 if (
const SfxEventHint* pHint = dynamic_cast<const SfxEventHint*>(&rHint))
488 if (pHint->GetEventId() == SfxEventHintId::ActivateDoc)
505 if (nHintId == SfxHintId::ScDocNameChanged)
517 case SfxHintId::ScTablesChanged:
521 case SfxHintId::ScDbAreasChanged:
525 case SfxHintId::ScAreasChanged:
529 case SfxHintId::ScDrawChanged:
535 case SfxHintId::ScAreaLinksChanged:
541 case SfxHintId::ScNavigatorUpdateAll:
545 case SfxHintId::ScDataChanged:
546 case SfxHintId::ScAnyDataChanged:
549 case SfxHintId::ScSelectionChanged:
561 if ( pIdle != &aContentIdle )
584 ScAddress aScAddress( nColNo, nRowNo, 0 );
587 bool bUnmark =
false;
595 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
596 { &aPosItem, &aUnmarkItem });
605 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
614 SfxUInt16Item aTabItem( SID_CURRENTTAB, static_cast<sal_uInt16>(nTabNo) + 1 );
616 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
628 SCTAB nLastSheet = 0;
633 if (aTabName == rName)
660 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
668 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
682 uno::Reference< container::XIndexAccess > xIndexAccess(
683 xShapes, uno::UNO_QUERY_THROW );
684 if( xIndexAccess->getCount() > 1 )
686 uno::Reference< drawing::XShape > xShape;
687 if( xIndexAccess->getByIndex(0) >>= xShape )
689 uno::Reference< container::XNamed > xNamed( xShape, uno::UNO_QUERY_THROW );
690 OUString
sName = xNamed->getName();
691 if (!sName.isEmpty())
801 rCfg.
SetListMode( static_cast<sal_uInt16>(eMode) );
806 pNav->InvalidateChildSizeCache();
807 Size aOptimalSize(pNav->GetOptimalSize());
808 Size aNewSize(pNav->GetOutputSizePixel());
811 pNav->SetOutputSizePixel(aNewSize);
856 if ( dynamic_cast<const ScDocShell*>( pSh) !=
nullptr )
859 OUString aEntry = aName;
860 if (pSh == pCurrentSh)
866 if ( pManualSel ? ( aName == *pManualSel )
867 : ( pSh == pCurrentSh ) )
877 if (!aHidden.isEmpty())
882 if ( pManualSel && aHidden == *pManualSel )
933 if ( (nCol+1 !=
m_xEdCol->get_value()) || (nRow+1 !=
m_xEdRow->get_value()) )
950 if ( (nCol+1 !=
m_xEdCol->get_value()) || (nRow+1 !=
m_xEdRow->get_value()) )
ScMarkData & GetMarkData()
std::unique_ptr< weld::ComboBox > m_xLbDocuments
#define LINK(Instance, Class, Member)
static sal_Int32 SCNAV_COLDIGITS(const ScSheetLimits &rLimits)
sal_uInt16 GetDragMode() const
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
void MarkDataArea(bool bIncludeCursor=true)
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 * >())
virtual ~ScNavigatorWin() override
static SCROW SCNAV_MAXROW(const ScSheetLimits &rSheetLimits)
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
void SetMinOutputSizePixel(const Size &rSize)
OUString ScResId(TranslateId aId)
void SetCurrentTable(SCTAB nTab)
OUString GetTitle(sal_uInt16 nMaxLen=0) const
IMPL_LINK(ScNavigatorDlg, ParseRowInputHdl, int *, result, bool)
ScNavigatorWin(SfxBindings *_pBindings, SfxChildWindow *pMgr, vcl::Window *pParent, SfxChildWinInfo *pInfo)
static bool isAsciiAlpha(std::u16string_view rStr)
SFX_IMPL_DOCKINGWINDOW(ScNavigatorWrapper, SID_NAVIGATOR)
std::unique_ptr< sal_Int32[]> pData
SCCOL GetMaxColCount() const
static sal_Int32 SCNAV_COLLETTERS(const ScSheetLimits &rLimits)
void UpdateTable(const SCTAB *pTab)
void ScColToAlpha(OUStringBuffer &rBuf, SCCOL nCol)
append alpha representation of column to buffer
Contains settings of the navigator listbox.
void SetWindow(const VclPtr< vcl::Window > &p)
ScDocument & GetDocument() const
static SfxObjectShell * Current()
std::unique_ptr< weld::SpinButton > m_xEdCol
void Invalidate(sal_uInt16 nId)
SCROW GetMaxRowCount() const
virtual weld::Window * GetFrameWeld() const override
virtual void StateChanged(StateChangedType nStateChange) override
const ScRange & GetMarkArea() const
void GetDocNames(const OUString *pSelEntry)
bool IsCellMarked(SCCOL nCol, SCROW nRow, bool bNoSimple=false) const
SfxApplication * SfxGetpApp()
css::uno::Reference< css::drawing::XShapes > getSelectedXShapes()
static bool isAsciiNumeric(std::u16string_view rStr)
o3tl::enumarray< ScContentId, bool > maExpandedVec
SC_DLLPUBLIC SCTAB GetTableCount() const
static SfxViewShell * Current()
void SetCurrentObject(const OUString &rName)
ScViewData & GetViewData()
std::unique_ptr< ScNavigatorDlg > m_xNavigator
std::unique_ptr< ScScenarioWindow > m_xWndScenarios
std::unique_ptr< ScArea > pMarkArea
std::unique_ptr< weld::Toolbar > m_xTbxCmd2
ScContentId GetRootType() const
std::unique_ptr< weld::Box > m_xContainer
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
void SetCurrentTableStr(std::u16string_view rName)
ScSheetLimits & GetSheetLimits() const
ScNavigatorSettings * GetNavigatorSettings()
static ScTabViewShell * GetTabViewShell()
void ShowList(bool bShow)
void SetDragMode(sal_uInt16 nNew)
void SetCurrentDoc(const OUString &rDocName)
void UpdateRow(const SCROW *pRow=nullptr)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
IMPL_LINK_NOARG(ScNavigatorDlg, ExecuteColHdl, weld::Entry &, bool)
std::array< std::unique_ptr< ScNavigatorControllerItem >, CTRL_ITEMS > mvBoundItems
bool ParentIsFloatingWindow(const vcl::Window *pParent)
static SCCOL SCNAV_MAXCOL(const ScSheetLimits &rLimits)
virtual void StateChanged(StateChangedType nStateChange) override
void SetCurrentCellStr(const OUString &rName)
friend class ScNavigatorControllerItem
void Update(sal_uInt16 nId)
bool AlphaToCol(const ScDocument &rDoc, SCCOL &rCol, const OUString &rStr)
get column number of A..IV... string
std::unique_ptr< weld::Widget > m_xScenarioBox
ScNavigatorWrapper(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
static ScNavigatorSettings * GetNavigatorSettings()
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
constexpr tools::Long Height() const
static SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
std::unique_ptr< weld::Menu > m_xDragModeMenu
ScNavigatorSettings()
Index of selected child entry.
std::unique_ptr< ScContentTree > m_xLbEntries
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
void SetCurrentCell(SCCOL nCol, SCROW Row)
sal_uInt16 GetListMode() const
ScNavigatorDlg(SfxBindings *pB, weld::Widget *pParent, SfxNavigator *pNavigatorDlg)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
vcl::Window * GetWindow() const
void setHeight(tools::Long nHeight)
virtual void Start(bool bStartTimer=true) override
void SetDropMode(sal_uInt16 nNew)
SfxDispatcher * GetDispatcher() const
virtual weld::Window * GetFrameWeld() const
reference_type * get() const
static SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
void SetPriority(TaskPriority ePriority)
static void ReleaseFocus()
std::unique_ptr< weld::SpinButton > m_xEdRow
void SetListMode(NavListMode eMode)
ScViewData * GetViewData()
void UpdateColumn(const SCCOL *pCol=nullptr)
virtual ~ScNavigatorDlg() override
virtual void dispose() override
VclPtr< SfxNavigator > m_xNavigatorDlg
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
void SetListMode(sal_uInt16 nNew)
virtual void dispose() override
const sal_uLong SC_CONTENT_NOCHILD
std::unique_ptr< weld::Toolbar > m_xTbxCmd1