/* -*- 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 "fuparagr.hxx" #include #include #include #include #include #include #include #include #include #include "app.hrc" #include "View.hxx" #include "ViewShell.hxx" #include "drawdoc.hxx" #include "sdabstdlg.hxx" #include "sdattr.hrc" #include namespace sd { TYPEINIT1( FuParagraph, FuPoor ); FuParagraph::FuParagraph ( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq) : FuPoor(pViewSh, pWin, pView, pDoc, rReq) { } rtl::Reference FuParagraph::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq ) { rtl::Reference xFunc( new FuParagraph( pViewSh, pWin, pView, pDoc, rReq ) ); xFunc->DoExecute(rReq); return xFunc; } void FuParagraph::DoExecute( SfxRequest& rReq ) { const SfxItemSet* pArgs = rReq.GetArgs(); OutlinerView* pOutlView = mpView->GetTextEditOutlinerView(); ::Outliner* pOutliner = mpView->GetTextEditOutliner(); if( !pArgs ) { SfxItemSet aEditAttr( mpDoc->GetPool() ); mpView->GetAttributes( aEditAttr ); SfxItemPool *pPool = aEditAttr.GetPool(); SfxItemSet aNewAttr( *pPool, EE_ITEMS_START, EE_ITEMS_END, SID_ATTR_TABSTOP_OFFSET, SID_ATTR_TABSTOP_OFFSET, ATTR_PARANUMBERING_START, ATTR_PARANUMBERING_END, 0 ); aNewAttr.Put( aEditAttr ); // left border is offset const long nOff = static_cast(aNewAttr.Get( EE_PARA_LRSPACE ) ).GetTxtLeft(); // conversion since TabulatorTabPage always uses Twips! SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff ); aNewAttr.Put( aOff ); if( pOutlView && pOutliner ) { ESelection eSelection = pOutlView->GetSelection(); aNewAttr.Put( SfxInt16Item( ATTR_NUMBER_NEWSTART_AT, pOutliner->GetNumberingStartValue( eSelection.nStartPara ) ) ); aNewAttr.Put( SfxBoolItem( ATTR_NUMBER_NEWSTART, pOutliner->IsParaIsNumberingRestart( eSelection.nStartPara ) ) ); } SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); boost::scoped_ptr pDlg(pFact ? pFact->CreateSdParagraphTabDlg(NULL, &aNewAttr ) : 0); if (!pDlg) return; sal_uInt16 nResult = pDlg->Execute(); switch( nResult ) { case RET_OK: { rReq.Done( *( pDlg->GetOutputItemSet() ) ); pArgs = rReq.GetArgs(); } break; default: return; // Cancel } } mpView->SetAttributes( *pArgs ); if( pOutlView && pOutliner ) { ESelection eSelection = pOutlView->GetSelection(); const SfxPoolItem *pItem = 0; if( SfxItemState::SET == pArgs->GetItemState( ATTR_NUMBER_NEWSTART, false, &pItem ) ) { const bool bNewStart = static_cast(pItem)->GetValue(); pOutliner->SetParaIsNumberingRestart( eSelection.nStartPara, bNewStart ); } if( SfxItemState::SET == pArgs->GetItemState( ATTR_NUMBER_NEWSTART_AT, false, &pItem ) ) { const sal_Int16 nStartAt = static_cast(pItem)->GetValue(); pOutliner->SetNumberingStartValue( eSelection.nStartPara, nStartAt ); } } // invalidate slots static sal_uInt16 SidArray[] = { SID_ATTR_TABSTOP, SID_ATTR_PARA_ADJUST_LEFT, SID_ATTR_PARA_ADJUST_RIGHT, SID_ATTR_PARA_ADJUST_CENTER, SID_ATTR_PARA_ADJUST_BLOCK, SID_ATTR_PARA_LINESPACE, SID_ATTR_PARA_LINESPACE_10, SID_ATTR_PARA_LINESPACE_15, SID_ATTR_PARA_LINESPACE_20, SID_ATTR_PARA_ULSPACE, SID_ATTR_PARA_LRSPACE, SID_ATTR_PARA_LEFT_TO_RIGHT, SID_ATTR_PARA_RIGHT_TO_LEFT, SID_RULER_TEXT_RIGHT_TO_LEFT, SID_PARASPACE_INCREASE, SID_PARASPACE_DECREASE, 0 }; mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray ); } void FuParagraph::Activate() { } void FuParagraph::Deactivate() { } } // end of namespace sd /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /option> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-05-07loplugin:ostr in chart2Noel Grandin
Change-Id: I2985b6793a776639214a25bf9732c000b9026bfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167236 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-22tdf#123936 Formatting files in module chart2 with clang-formatPhilipp Hofer
Change-Id: Ie4dea73190040e5716fe531cf35fae20d7e175db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105650 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-08-06tdf#135184 add linecaps in chartsRegina Henschel
Chart is currently not able to interpret property linecap. But in case of linecap 'round' or 'square', line dashes lengths are adapted so that they look same as in MS Office (tdf#134053). This does not work, if the corresponding linecap property is not interpreted. Dashed border of data labels is not fixed because of bug tdf#135366. In addition I have fixed errors in prstDash detection, which I have noticed while creating unit tests. The unit tests cover file text, not visual appearence. Change-Id: I8cf2d2b2fc0923c2882f8148b4550bc363270480 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99562 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2019-11-21tdf#42949 tdf#119699 Fix IWYU warnings in chart2/Gabor Kelemen
* Recheck after recent refactorings and improvements in f-u-i * Drop now unused TabPageIds.h * The problem noticed in bug #119699 now seems to be gone too so drop those lines from the blacklist. Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I44f26c7370f5328c8f67ac61cd8f0cdb29077f15 Reviewed-on: https://gerrit.libreoffice.org/83182 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-06-14loplugin:logexceptionnicely in chart2Noel Grandin
Change-Id: Ib7933723e5506578bbc85cc431d54d1ed8466376 Reviewed-on: https://gerrit.libreoffice.org/74019 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-09Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from a* to configmgr Change-Id: I6ea1a7f992b1f835f5bac7a725e1135abee3f85a Reviewed-on: https://gerrit.libreoffice.org/57170 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-01tdf#42949 Fix IWYU warnings in chart2/source/view/inc/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here and a bit of fallout management. Change-Id: I1eb30323e083afca7c024d494856ccc66c41482d Reviewed-on: https://gerrit.libreoffice.org/55037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-03inline ASSERT_EXCEPTION macro in chart2Noel Grandin
Change-Id: I6bdcde5fd416531e2cdd3c9ec160833f1022247c Reviewed-on: https://gerrit.libreoffice.org/44246 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: chart2Stephan Bergmann
Change-Id: I5b455c684e7cd689d5160135246f3400363c7d40
2017-08-02remove unnecessary use of 'this->'Noel Grandin
Change-Id: I5c115389af7d24c18ddaf5fbec8c00f35017a5b4 Reviewed-on: https://gerrit.libreoffice.org/40671 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-23loplugin:comparisonwithconstant in chart2Noel Grandin
Change-Id: I95787007b26cdcf0d5d1617ecd0e55d377b551d7 Reviewed-on: https://gerrit.libreoffice.org/37941 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-03makeAny->Any in basctl..chart2Noel Grandin
Change-Id: Ief1cdffbfc59ab4e35ac945d020772ff84c50d61 Reviewed-on: https://gerrit.libreoffice.org/33867 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-03-02loplugin:unuseddefaultparams in chart2Noel Grandin
Change-Id: I03a3580fdbd1f6cf08af329b07edcfe09ecbb9aa