/* -*- 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/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include #include #include #include #include #include #include using namespace dbaui; OTableWindowTitle::OTableWindowTitle(OTableWindow* pParent) : InterimItemWindow(pParent, u"dbaccess/ui/tabletitle.ui"_ustr, u"TableTitle"_ustr) , m_pTabWin( pParent ) , m_xLabel(m_xBuilder->weld_label(u"label"_ustr)) , m_xImage(m_xBuilder->weld_image(u"image"_ustr)) { m_xLabel->connect_mouse_press(LINK(this, OTableWindowTitle, MousePressHdl)); } OTableWindowTitle::~OTableWindowTitle() { disposeOnce(); } void OTableWindowTitle::dispose() { m_xImage.reset(); m_xLabel.reset(); m_pTabWin.clear(); InterimItemWindow::dispose(); } IMPL_LINK(OTableWindowTitle, MousePressHdl, const MouseEvent&, rEvt, bool) { if (rEvt.IsLeft()) { if( rEvt.GetClicks() == 2) { Size aSize(GetTextWidth(GetText()) + 20, m_pTabWin->GetSizePixel().Height() - m_pTabWin->GetListBox()->GetSizePixel().Height()); weld::TreeView& rTreeView = m_pTabWin->GetListBox()->get_widget(); aSize.AdjustHeight(rTreeView.get_height_rows(rTreeView.n_children() + 2)); if (m_pTabWin->GetSizePixel() != aSize) { m_pTabWin->SetSizePixel(aSize); OJoinTableView* pView = m_pTabWin->getTableView(); assert(pView && "No OJoinTableView!"); for (auto& conn : pView->getTableConnections()) conn->RecalcLines(); pView->InvalidateConnections(); pView->getDesignView()->getController().setModified(true); pView->Invalidate(InvalidateFlags::NoChildren); } } else { Point aPos = rEvt.GetPosPixel(); aPos = OutputToScreenPixel( aPos ); OJoinTableView* pView = m_pTabWin->getTableView(); OSL_ENSURE(pView,"No OJoinTableView!"); pView->NotifyTitleClicked( static_cast(GetParent()), aPos ); } } else if (rEvt.IsRight()) { CommandEvent aCEvt(rEvt.GetPosPixel(), CommandEventId::ContextMenu, true); // tdf#94709 - protect shutdown code-path. VclPtr xTabWin(m_pTabWin); xTabWin->Command(aCEvt); } return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ p-4.0'>distro/collabora/cp-4.0 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2024-10-21fix(lok): Expose the character encoding dialogSkyler Grey
2024-05-16loplugin:ostr in writerperfectNoel Grandin
2024-03-13reduce symbol visibility in --enable-mergelibs=more modeNoel Grandin
2024-03-11Use weak reference to SfxObjectShell in SfxEventHint to avoid use-after-freeMike Kaganski
2023-11-14loplugin:unusedfieldsNoel Grandin
2023-10-12Make NC_ constexpr-friendlyStephan Bergmann
2023-09-19loplugin:unusedfieldsNoel Grandin
2023-09-13loplugin:unusedmethodsNoel Grandin
2023-08-21remove pimpl in WPXSvInputStreamNoel Grandin
2022-11-22loplugin:unusedfieldsNoel Grandin
2022-07-31clang-tidy modernize-pass-by-value in writer*Noel Grandin
2021-12-03UBSan still needs RTTI of some types to be exportedStephan Bergmann
2021-12-01improve the script for reducing symbol exportsNoel Grandin
2021-11-08use more OUStringLiteral in MediaDescriptorNoel Grandin
2021-11-05use more DECL_DLLPRIVATE_LINKNoel Grandin
2021-11-01Prepare for removal of non-const operator[] from Sequence in writerperfectMike Kaganski
2021-09-04dynamic_cast -> static_cast (tdf#130795)Noel Grandin
2021-08-05Pass context and resource string down to boost::locale separatelyNoel Grandin
2021-06-17use string_view in the Translate APINoel Grandin
2021-03-23tdf#124176 Use pragma once in w*Vincent LE GARREC
2020-11-11make tools::Long 64-bit on Windows platformNoel Grandin
2020-10-26switching long to a 64-bit type on 64-bit windowsNoel
2020-10-16writerfilter: use the fastparser API when possibleNoel
2020-07-20compact namespace: writerperfectNoel Grandin