/* -*- 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 #include #include #include #include #include #include "imapwrap.hxx" #include #include #include #include #include class SvxIMapDlg; void ScTabViewShell::ExecChildWin(const SfxRequest& rReq) { sal_uInt16 nSlot = rReq.GetSlot(); switch(nSlot) { case SID_GALLERY: { // First make sure that the sidebar is visible GetViewFrame().ShowChildWindow(SID_SIDEBAR); ::sfx2::sidebar::Sidebar::ShowPanel( u"GalleryPanel", GetViewFrame().GetFrame().GetFrameInterface()); } break; } } void ScTabViewShell::ExecGallery( const SfxRequest& rReq ) { const SfxItemSet* pArgs = rReq.GetArgs(); const SvxGalleryItem* pGalleryItem = SfxItemSet::GetItem(pArgs, SID_GALLERY_FORMATS, false); if ( !pGalleryItem ) return; sal_Int8 nType( pGalleryItem->GetType() ); if ( nType == css::gallery::GalleryItemType::GRAPHIC ) { MakeDrawLayer(); Graphic aGraphic( pGalleryItem->GetGraphic() ); Point aPos = GetInsertPos(); PasteGraphic( aPos, aGraphic, OUString() ); } else if ( nType == css::gallery::GalleryItemType::MEDIA ) { // for sounds (linked or not), insert a hyperlink button, // like in Impress and Writer const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, pGalleryItem->GetURL() ); GetViewFrame().GetDispatcher()->ExecuteList(SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON, { &aMediaURLItem }); } } void ScTabViewShell::ExecImageMap( SfxRequest& rReq ) { sal_uInt16 nSlot = rReq.GetSlot(); switch(nSlot) { case SID_IMAP: { SfxViewFrame& rThisFrame = GetViewFrame(); sal_uInt16 nId = ScIMapChildWindowId(); rThisFrame.ToggleChildWindow( nId ); GetViewFrame().GetBindings().Invalidate( SID_IMAP ); if ( rThisFrame.HasChildWindow( nId ) ) { SvxIMapDlg* pDlg = GetIMapDlg(); if ( pDlg ) { SdrView* pDrView = GetScDrawView(); if ( pDrView ) { const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); if ( rMarkList.GetMarkCount() == 1 ) UpdateIMap( rMarkList.GetMark( 0 )->GetMarkedSdrObj() ); } } } rReq.Ignore(); } break; case SID_IMAP_EXEC: { SdrView* pDrView = GetScDrawView(); SdrMark* pMark = pDrView ? pDrView->GetMarkedObjectList().GetMark(0) : nullptr; if ( pMark ) { SdrObject* pSdrObj = pMark->GetMarkedSdrObj(); SvxIMapDlg* pDlg = GetIMapDlg(); if ( ScIMapDlgGetObj(pDlg) == static_cast(pSdrObj) ) { const ImageMap& rImageMap = ScIMapDlgGetMap(pDlg); SvxIMapInfo* pIMapInfo = SvxIMapInfo::GetIMapInfo( pSdrObj ); if ( !pIMapInfo ) pSdrObj->AppendUserData( std::unique_ptr(new SvxIMapInfo( rImageMap )) ); else pIMapInfo->SetImageMap( rImageMap ); GetViewData().GetDocShell()->SetDrawModified(); } } } break; } } void ScTabViewShell::GetImageMapState( SfxItemSet& rSet ) { SfxWhichIter aIter(rSet); sal_uInt16 nWhich = aIter.FirstWhich(); while ( nWhich ) { switch ( nWhich ) { case SID_IMAP: { // We don't disable this anymore bool bThere = false; SfxViewFrame& rThisFrame = GetViewFrame(); sal_uInt16 nId = ScIMapChildWindowId(); if ( rThisFrame.KnowsChildWindow(nId) ) if ( rThisFrame.HasChildWindow(nId) ) bThere = true; ObjectSelectionType eType=GetCurObjectSelectionType(); bool bEnable=(eType==OST_OleObject) ||(eType==OST_Graphic); if(!bThere && !bEnable) { rSet.DisableItem( nWhich ); } else { rSet.Put( SfxBoolItem( nWhich, bThere ) ); } } break; case SID_IMAP_EXEC: { bool bDisable = true; SdrView* pDrView = GetScDrawView(); if ( pDrView ) { const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); if ( rMarkList.GetMarkCount() == 1 ) if ( ScIMapDlgGetObj(GetIMapDlg()) == static_cast(rMarkList.GetMark(0)->GetMarkedSdrObj()) ) bDisable = false; } rSet.Put( SfxBoolItem( SID_IMAP_EXEC, bDisable ) ); } break; } nWhich = aIter.NextWhich(); } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ >distro/lhm/libreoffice-7-2+backports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-06[API CHANGE] oox: fix import of chart date categoriesDennis Francis
Before this fix, date categories imported in oox's DataSourceContext were stored as formatted strings according to number format code in <c:formatCode> under the <c:cat> tree. As a result chart2 could not recognize them as dates. This causes problems like: * The axis that is linked to date categories cannot use the scaling/range-selection(min/max)/increments specs mentioned as axis properties. This results in distorted/unreadable chart renders w.r.t the date axis. * No re-formatting is attempted as per the number format provided for axis. This patch introduces a role qualifer argument to the XDataProvider interface method createDataSequenceByValueArray to support categories of date type via this method. When exporting to oox, write date categories and format code under <c:cat> <c:numRef> <c:numCache> This patch also fixes some discrepancies in date axis interval computation (auto mode) found by already existing unit tests. Change-Id: Ibc53b0a56fdddba80ba452d5567ce98d80460ea7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121525 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-31new loplugin:namespaceindentationNoel Grandin
check indentation of braces in namespace decls, and the comments that often appear with them. This is my penance for messing up the indentation with clang-tidy-modernize-namespaces. As such I have limited it to new-style namespaces for now, and the check is off by default. Change-Id: I4db7f10a81c79bc0eece8f8e3ee564da8bc7f168 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15clang-tidy modernize-concat-nested-namespace in ooxNoel Grandin
Change-Id: I9877be75e1f7dcefdf7172d05dfbb0a63d06ced1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86803 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-24tdf#114166 DOCX chart import: fix missing complex categoriesBalazs Varga
Now complex category labels are visible, and the inner data table contains the correct texts of the category columns. Note: repeating call of createDataSequenceByValueArray() API function can create all columns of the complex categories. See also commit 6c4e21a234f12e1310ba06f9859e08b424acf8bf "bnc#812796: Correctly handle static value array for OOXML charts." Change-Id: I333b79be35a24a912bb9e662116d0c85809a8fb2 Reviewed-on: https://gerrit.libreoffice.org/75776 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2017-10-23loplugin:includeform: ooxStephan Bergmann
Change-Id: I9f1cc9940f5b31370394f789ebfaddfd6d30ca61