LibreOffice Module sw (master) 1
vbaselection.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#include "vbaselection.hxx"
20#include <utility>
22#include "vbarange.hxx"
23#include "vbafind.hxx"
24#include <com/sun/star/text/XTextRange.hpp>
25#include <com/sun/star/text/XTextTable.hpp>
26#include <com/sun/star/text/XTextTableCursor.hpp>
27#include <com/sun/star/table/XCell.hpp>
28#include <basic/sberrors.hxx>
29#include <ooo/vba/word/WdUnits.hpp>
30#include <ooo/vba/word/WdMovementType.hpp>
31#include <ooo/vba/word/WdGoToItem.hpp>
32#include <ooo/vba/word/WdGoToDirection.hpp>
33#include <ooo/vba/word/XBookmark.hpp>
34#include <ooo/vba/word/XApplication.hpp>
35#include <ooo/vba/word/WdCollapseDirection.hpp>
36#include <com/sun/star/text/XPageCursor.hpp>
37#include <unotbl.hxx>
38#include <unocoll.hxx>
39#include "vbatable.hxx"
40#include <com/sun/star/view/XViewCursor.hpp>
41#include <com/sun/star/view/XLineCursor.hpp>
42#include <com/sun/star/text/XWordCursor.hpp>
43#include <com/sun/star/text/XParagraphCursor.hpp>
44#include <ooo/vba/word/WdInformation.hpp>
45#include <ooo/vba/word/WdHeaderFooterIndex.hpp>
46#include <ooo/vba/word/WdSeekView.hpp>
48#include "vbafield.hxx"
49#include "vbaheaderfooter.hxx"
52#include <com/sun/star/drawing/ShapeCollection.hpp>
53#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
54#include <com/sun/star/drawing/XDrawPage.hpp>
55#include "vbarows.hxx"
56#include "vbacolumns.hxx"
57#include "vbatablehelper.hxx"
58#include "vbacells.hxx"
59#include "vbaview.hxx"
60#include "vbaparagraph.hxx"
61#include "vbastyle.hxx"
62#include <docsh.hxx>
63#include <tblenum.hxx>
64#include <sal/log.hxx>
65#include <fesh.hxx>
66
67using namespace ::ooo::vba;
68using namespace ::com::sun::star;
69
70SwVbaSelection::SwVbaSelection( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, uno::Reference< frame::XModel > xModel ) : SwVbaSelection_BASE( rParent, rContext ), mxModel(std::move( xModel ))
71{
73}
74
76{
77}
78
79uno::Reference< text::XTextRange > SwVbaSelection::GetSelectedRange()
80{
81 uno::Reference< text::XTextRange > xTextRange;
82 uno::Reference< lang::XServiceInfo > xServiceInfo( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
83 if( !xServiceInfo->supportsService("com.sun.star.text.TextRanges") )
84 {
85 throw uno::RuntimeException("Not implemented" );
86 }
87
88 uno::Reference< container::XIndexAccess > xTextRanges( xServiceInfo, uno::UNO_QUERY_THROW );
89 if( xTextRanges->getCount() > 0 )
90 {
91 // if there are multiple selection, just return the last selected Range.
92 xTextRange.set( xTextRanges->getByIndex( xTextRanges->getCount()-1 ), uno::UNO_QUERY_THROW );
93 }
94
95 return xTextRange;
96}
97
98uno::Reference< word::XRange > SAL_CALL
100{
101 uno::Reference< text::XTextRange > xTextRange = GetSelectedRange();
102 uno::Reference< text::XTextDocument > xDocument( mxModel, uno::UNO_QUERY_THROW );
103 return uno::Reference< word::XRange >( new SwVbaRange( this, mxContext, xDocument, xTextRange->getStart(), xTextRange->getEnd(), mxTextViewCursor->getText() ) );
104}
105
106OUString SAL_CALL
108{
109 return getRange()->getText();
110}
111
112void SAL_CALL
113SwVbaSelection::setText( const OUString& rText )
114{
115 getRange()->setText( rText );
116}
117
118void SAL_CALL
119SwVbaSelection::TypeText( const OUString& rText )
120{
121 // FIXME: handle the property Options.ReplaceSelection, the default value is true
122 setText( rText );
123}
124
125void SAL_CALL
126SwVbaSelection::HomeKey( const uno::Any& _unit, const uno::Any& _extend )
127{
128 sal_Int32 nUnit = word::WdUnits::wdLine;
129 sal_Int32 nExtend = word::WdMovementType::wdMove;
130 _unit >>= nUnit;
131 _extend >>= nExtend;
132 bool bExtend = nExtend == word::WdMovementType::wdExtend;
133
134 switch( nUnit )
135 {
136 case word::WdUnits::wdStory:
137 {
138 // go to the valid text first so that the current view cursor is valid to call gotoRange.
140 // go to the begin of the document
141 uno::Reference< text::XText > xCurrentText = word::getCurrentXText( mxModel );
142 uno::Reference< text::XTextRange > xFirstRange = word::getFirstObjectPosition( xCurrentText );
143 mxTextViewCursor->gotoRange( xFirstRange, bExtend );
144 break;
145 }
146 case word::WdUnits::wdLine:
147 {
148 // go to the begin of the Line
149 uno::Reference< view::XLineCursor > xLineCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
150 xLineCursor->gotoStartOfLine( bExtend );
151 break;
152 }
153 default:
154 {
155 throw uno::RuntimeException("Not implemented" );
156 }
157 }
158}
159
160void SAL_CALL
161SwVbaSelection::EndKey( const uno::Any& _unit, const uno::Any& _extend )
162{
163 sal_Int32 nUnit = word::WdUnits::wdLine;
164 sal_Int32 nExtend = word::WdMovementType::wdMove;
165 _unit >>= nUnit;
166 _extend >>= nExtend;
167 bool bExtend = nExtend == word::WdMovementType::wdExtend;
168
169 switch( nUnit )
170 {
171 case word::WdUnits::wdStory:
172 {
173 // go to the valid text first so that the current view cursor is valid to call gotoRange.
175 // go to the end of the document
176 uno::Reference< text::XText > xCurrentText = word::getCurrentXText( mxModel );
177 uno::Reference< text::XTextRange > xEnd = xCurrentText->getEnd();
178 mxTextViewCursor->gotoRange( xEnd, bExtend );
179 break;
180 }
181 case word::WdUnits::wdLine:
182 {
183 // go to the end of the Line
184 uno::Reference< view::XLineCursor > xLineCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
185 xLineCursor->gotoEndOfLine( bExtend );
186 break;
187 }
188 default:
189 {
190 throw uno::RuntimeException("Not implemented" );
191 }
192 }
193}
194
195void SAL_CALL
196SwVbaSelection::Delete( const uno::Any& _unit, const uno::Any& _count )
197{
198 sal_Int32 nUnit = word::WdUnits::wdLine;
199 sal_Int32 nCount = 0;
200 if( _count.hasValue() )
201 _count >>= nCount;
202 if( _unit.hasValue() && ( nCount > 0 ) )
203 {
204 _unit >>= nUnit;
205 switch( nUnit )
206 {
207 case word::WdUnits::wdCharacter:
208 {
209 if( HasSelection() )
210 nCount--;
211 mxTextViewCursor->goRight( nCount, true );
212 break;
213 }
214 default:
215 {
216 throw uno::RuntimeException("Not implemented" );
217 }
218 }
219 }
220 dispatchRequests( mxModel,".uno:Delete" );
221}
222
223void
224SwVbaSelection::Move( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend, word::E_DIRECTION eDirection )
225{
226 sal_Int32 nUnit = word::WdUnits::wdCharacter;
227 sal_Int32 nCount = 1;
228 sal_Int32 nExtend = word::WdMovementType::wdMove;
229
230 if( _unit.hasValue() )
231 _unit >>= nUnit;
232 if( _count.hasValue() )
233 _count >>= nCount;
234 if( _extend.hasValue() )
235 _extend >>= nExtend;
236
237 if( nCount == 0 )
238 return;
239
240 bool bExpand = nExtend != word::WdMovementType::wdMove;
241
242 switch( nUnit )
243 {
244 case word::WdUnits::wdCell:
245 {
246 if( nExtend == word::WdMovementType::wdExtend )
247 {
248 DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
249 return;
250 }
251 NextCell( nCount, eDirection );
252 break;
253 }
254 case word::WdUnits::wdLine:
255 {
256 if( eDirection == word::MOVE_LEFT || eDirection == word::MOVE_RIGHT )
257 {
258 throw uno::RuntimeException("Not implemented" );
259 }
260 uno::Reference< view::XViewCursor > xViewCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
261 if( eDirection == word::MOVE_UP )
262 xViewCursor->goUp( nCount, bExpand );
263 else if( eDirection == word::MOVE_DOWN )
264 xViewCursor->goDown( nCount, bExpand );
265 break;
266 }
267 case word::WdUnits::wdCharacter:
268 {
269 if( eDirection == word::MOVE_UP || eDirection == word::MOVE_DOWN )
270 {
271 throw uno::RuntimeException("Not implemented" );
272 }
274 {
275 nCount--;
276 }
277 uno::Reference< view::XViewCursor > xViewCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
278 if( eDirection == word::MOVE_LEFT )
279 {
280 // if current select is a cellrange or table,
281 // the first count of move should move to the first selected cell.
282 uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY );
283 if ( xTextTableCursor.is() )
284 {
285 uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
286 uno::Reference< text::XTextTable > xTextTable;
287 xCursorProps->getPropertyValue("TextTable") >>= xTextTable;
288 if( xTextTable.is() )
289 {
290 uno::Reference< text::XTextRange > xRange( xTextTable->getCellByName( xTextTableCursor->getRangeName()), uno::UNO_QUERY_THROW );
291 mxTextViewCursor->gotoRange( xRange->getStart(), bExpand );
292 nCount--;
293 }
294 }
295 xViewCursor->goLeft( nCount, bExpand );
296 }
297 else if( eDirection == word::MOVE_RIGHT )
298 xViewCursor->goRight( nCount, bExpand );
299 break;
300 }
301 case word::WdUnits::wdWord:
302 case word::WdUnits::wdParagraph:
303 {
304 uno::Reference< text::XTextRange > xRange = GetSelectedRange();
305 uno::Reference< text::XText > xText = xRange->getText();
306 uno::Reference< text::XTextCursor > xTextCursor = xText->createTextCursorByRange( xRange );
307 if( nUnit == word::WdUnits::wdParagraph )
308 {
309 if( eDirection == word::MOVE_LEFT || eDirection == word::MOVE_RIGHT )
310 {
311 throw uno::RuntimeException("Not implemented" );
312 }
313 uno::Reference< text::XParagraphCursor > xParagraphCursor( xTextCursor, uno::UNO_QUERY_THROW );
314 for( sal_Int32 i=0; i<nCount; i++ )
315 {
316 if( ( eDirection == word::MOVE_UP ) && !xParagraphCursor->gotoPreviousParagraph( bExpand ) )
317 break;
318 else if( ( eDirection == word::MOVE_DOWN ) && !xParagraphCursor->gotoNextParagraph( bExpand ) )
319 break;
320 }
321 }
322 else if( nUnit == word::WdUnits::wdWord )
323 {
324 if( eDirection == word::MOVE_UP || eDirection == word::MOVE_DOWN )
325 {
326 throw uno::RuntimeException("Not implemented" );
327 }
328 uno::Reference< text::XWordCursor > xWordCursor( xTextCursor, uno::UNO_QUERY_THROW );
329 for( sal_Int32 i=0; i<nCount; i++ )
330 {
331 if( (eDirection == word::MOVE_LEFT ) && !xWordCursor->gotoPreviousWord( bExpand ) )
332 break;
333 else if( ( eDirection == word::MOVE_RIGHT ) && !xWordCursor->gotoNextWord( bExpand ) )
334 break;
335 }
336 }
337 mxTextViewCursor->gotoRange( xTextCursor->getStart(), false );
338 mxTextViewCursor->gotoRange( xTextCursor->getEnd(), true );
339 break;
340 }
341 default:
342 {
343 throw uno::RuntimeException("Not implemented" );
344 }
345 }
346}
347
348void SwVbaSelection::NextCell(sal_Int32 nCount, word::E_DIRECTION eDirection)
349{
350 uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
351 uno::Reference< text::XTextTable > xTextTable;
352 uno::Reference< table::XCell > xCell;
353 xCursorProps->getPropertyValue("TextTable") >>= xTextTable;
354 xCursorProps->getPropertyValue("Cell") >>= xCell;
355 if( !xTextTable.is() || !xCell.is() )
356 {
357 DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
358 return;
359 }
360 uno::Reference< beans::XPropertySet > xCellProps( xCell, uno::UNO_QUERY_THROW );
361 OUString aCellName;
362 xCellProps->getPropertyValue("CellName") >>= aCellName;
363 uno::Reference< text::XTextTableCursor > xTextTableCursor = xTextTable->createCursorByCellName( aCellName );
364 // move the table cursor
365 switch( eDirection )
366 {
367 case word::MOVE_LEFT:
368 {
369 xTextTableCursor->goLeft( nCount, false );
370 break;
371 }
372 case word::MOVE_RIGHT:
373 {
374 xTextTableCursor->goRight( nCount, false );
375 break;
376 }
377 case word::MOVE_UP:
378 {
379 xTextTableCursor->goUp( nCount, false );
380 break;
381 }
382 case word::MOVE_DOWN:
383 {
384 xTextTableCursor->goDown( nCount, false );
385 break;
386 }
387 default:
388 {
389 DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
390 return;
391 }
392 }
393 // move the view cursor
394 xCell = xTextTable->getCellByName( xTextTableCursor->getRangeName() );
395 mxTextViewCursor->gotoRange( uno::Reference< text::XTextRange >( xCell, uno::UNO_QUERY_THROW ), false );
396}
397
398void SAL_CALL
399SwVbaSelection::MoveRight(const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend)
400{
401 sal_Int32 nCount = 1;
402
403 if( _count.hasValue() )
404 _count >>= nCount;
405
406 if( nCount == 0 )
407 return;
408
409 if( nCount < 0 )
410 {
411 MoveLeft( _unit, uno::Any( -nCount ), _extend );
412 return;
413 }
414
415 Move( _unit, _count, _extend, word::MOVE_RIGHT );
416}
417
418void SAL_CALL
419SwVbaSelection::MoveLeft(const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend)
420{
421 sal_Int32 nCount = 1;
422 if( _count.hasValue() )
423 _count >>= nCount;
424
425 if( nCount == 0 )
426 return;
427
428 if( nCount < 0 )
429 {
430 MoveRight( _unit, uno::Any( -nCount ), _extend );
431 return;
432 }
433
434 Move( _unit, _count, _extend, word::MOVE_LEFT );
435}
436
437void SAL_CALL
438SwVbaSelection::MoveDown(const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend)
439{
440 sal_Int32 nCount = 1;
441
442 if( _count.hasValue() )
443 _count >>= nCount;
444
445 if( nCount == 0 )
446 return;
447
448 if( nCount < 0 )
449 {
450 MoveUp( _unit, uno::Any( -nCount ), _extend );
451 return;
452 }
453
454 Move( _unit, _count, _extend, word::MOVE_DOWN );
455}
456
457void SAL_CALL
458SwVbaSelection::MoveUp(const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend)
459{
460 sal_Int32 nCount = 1;
461
462 if( _count.hasValue() )
463 _count >>= nCount;
464
465 if( nCount == 0 )
466 return;
467
468 if( nCount < 0 )
469 {
470 MoveDown( _unit, uno::Any( -nCount ), _extend );
471 return;
472 }
473
474 Move( _unit, _count, _extend, word::MOVE_UP );
475}
476
477void SAL_CALL
479{
480 // #FIXME: if the selection is an entire paragraph, it's replaced
481 // by the new paragraph
482 bool isCollapsed = mxTextViewCursor->isCollapsed();
484 if( isCollapsed )
485 mxTextViewCursor->collapseToStart();
486}
487
488void SAL_CALL
490{
491 // #FIXME: the selection should include the new paragraph.
492 getRange()->InsertParagraph();
493}
494
495void SAL_CALL
497{
498 getRange()->InsertParagraphBefore();
499}
500
501void SAL_CALL
503{
504 getRange()->InsertParagraphAfter();
505}
506
507uno::Reference< word::XParagraphFormat > SAL_CALL
509{
510 return getRange()->getParagraphFormat();
511}
512
513void SAL_CALL
514SwVbaSelection::setParagraphFormat( const uno::Reference< word::XParagraphFormat >& rParagraphFormat )
515{
516 return getRange()->setParagraphFormat( rParagraphFormat );
517}
518
519uno::Reference< word::XFind > SAL_CALL
521{
522 uno::Reference< text::XTextRange > xTextRange = GetSelectedRange();
523 uno::Reference< text::XTextRange > xStart = xTextRange->getStart();
524 uno::Reference< text::XTextRange > xEnd = xTextRange->getEnd();
525 uno::Reference< text::XTextRangeCompare > xTRC( xTextRange->getText(), uno::UNO_QUERY_THROW );
526 int n = xTRC->compareRegionStarts( xStart, xEnd);
527 if( n == 0 )
528 {
529 WholeStory();
530 xTextRange = GetSelectedRange();
531 }
532 return SwVbaFind::GetOrCreateFind(this, mxContext, mxModel, xTextRange);
533}
534
535uno::Any SAL_CALL
537{
538 return getRange()->getStyle();
539}
540
541void SAL_CALL
543{
544 uno::Reference< beans::XPropertySet > xParaProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
545 return SwVbaStyle::setStyle( xParaProps, rStyle );
546}
547
548uno::Reference< word::XFont > SAL_CALL
550{
551 return getRange()->getFont();
552}
553
554void SAL_CALL
556{
557 dispatchRequests( mxModel,".uno:SwBackspace" );
558}
559
560uno::Reference< word::XRange > SAL_CALL SwVbaSelection::GoTo( const uno::Any& _what, const uno::Any& _which, const uno::Any& _count, const uno::Any& _name )
561{
562 sal_Int32 nWhat = 0;
563 if( !( _what >>= nWhat ) )
564 DebugHelper::basicexception(ERRCODE_BASIC_BAD_ARGUMENT, {});
565 switch( nWhat )
566 {
567 case word::WdGoToItem::wdGoToBookmark:
568 {
569 uno::Reference< word::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW );
570 uno::Reference< word::XBookmark > xBookmark( xApplication->getActiveDocument()->Bookmarks(_name), uno::UNO_QUERY_THROW );
571 xBookmark->Select();
572 break;
573 }
574 case word::WdGoToItem::wdGoToPage:
575 {
576 uno::Reference< text::XPageCursor > xPageCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
577 sal_Int32 nCurrPage = xPageCursor->getPage();
578 sal_Int32 nLastPage = word::getPageCount( mxModel );
579 sal_Int32 nCount = 0;
580 if( _count.hasValue() )
581 _count >>= nCount;
582 sal_Int32 nWhich = 0;
583 if( _which.hasValue() )
584 _which >>= nWhich;
585 sal_Int32 nPage = 0;
586 switch( nWhich )
587 {
588 case word::WdGoToDirection::wdGoToLast:
589 {
590 nPage = nLastPage;
591 break;
592 }
593 case word::WdGoToDirection::wdGoToNext:
594 {
595 if( nCount !=0 )
596 nPage = nCurrPage + nCount;
597 else
598 nPage = nCurrPage + 1;
599 break;
600 }
601 case word::WdGoToDirection::wdGoToPrevious:
602 {
603 if( nCount !=0 )
604 nPage = nCurrPage - nCount;
605 else
606 nPage = nCurrPage - 1;
607 break;
608 }
609 default:
610 {
611 nPage = nCount;
612 }
613 }
614 if( _name.hasValue() )
615 {
616 OUString sName;
617 _name >>= sName;
618 sal_Int32 nName = sName.toInt32();
619 if( nName !=0 )
620 nPage = nName;
621 }
622 if( nPage <= 0 )
623 nPage = 1;
624 if( nPage > nLastPage )
625 nPage = nLastPage;
626 xPageCursor->jumpToPage( static_cast<sal_Int16>(nPage) );
627 break;
628 }
629 case word::WdGoToItem::wdGoToSection:
630 {
631 uno::Reference< text::XPageCursor > xPageCursor( mxTextViewCursor, uno::UNO_QUERY_THROW );
632 sal_Int32 nCount = 0;
633 if( _count.hasValue() )
634 _count >>= nCount;
635 sal_Int32 nWhich = 0;
636 if( _which.hasValue() )
637 _which >>= nWhich;
638 sal_Int32 nPage = 0;
639 switch( nWhich )
640 {
641 case word::WdGoToDirection::wdGoToAbsolute:
642 {
643 // currently only support this type
644 if( nCount == 1 )
645 nPage = 1;
646 break;
647 }
648 default:
649 {
650 nPage = 0;
651 }
652 }
653 if( nPage == 0 )
654 throw uno::RuntimeException("Not implemented" );
655 xPageCursor->jumpToPage( static_cast<sal_Int16>(nPage) );
656 break;
657 }
658 default:
659 throw uno::RuntimeException("Not implemented" );
660 }
661 return getRange();
662}
663
664::sal_Int32 SAL_CALL SwVbaSelection::getLanguageID()
665{
666 return getRange()->getLanguageID();
667}
668
669void SAL_CALL SwVbaSelection::setLanguageID( ::sal_Int32 _languageid )
670{
671 getRange()->setLanguageID( _languageid );
672}
673
674uno::Any SAL_CALL SwVbaSelection::Information( sal_Int32 _type )
675{
677 switch( _type )
678 {
679 case word::WdInformation::wdActiveEndPageNumber:
680 {
682 break;
683 }
684 case word::WdInformation::wdNumberOfPagesInDocument:
685 {
687 break;
688 }
689 case word::WdInformation::wdVerticalPositionRelativeToPage:
690 {
692 break;
693 }
694 case word::WdInformation::wdWithInTable:
695 {
696 uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
697 uno::Reference< text::XTextTable > xTextTable;
698 xCursorProps->getPropertyValue("TextTable") >>= xTextTable;
699 result <<= xTextTable.is();
700 break;
701 }
702 case word::WdInformation::wdHeaderFooterType:
703 {
704 uno::Reference< word::XView > xView( new SwVbaView( this, mxContext, mxModel ) );
705 sal_Int32 nView = xView->getSeekView();
706 sal_Int32 nHeaderFooterType = 0;
707 switch( nView )
708 {
709 case word::WdSeekView::wdSeekMainDocument:
710 {
711 nHeaderFooterType = -1; // not in a header or footer
712 break;
713 }
714 case word::WdSeekView::wdSeekEvenPagesHeader:
715 {
716 nHeaderFooterType = 0; // even page header
717 break;
718 }
719 case word::WdSeekView::wdSeekPrimaryHeader:
720 {
721 nHeaderFooterType = 1; // odd page header
722 break;
723 }
724 case word::WdSeekView::wdSeekEvenPagesFooter:
725 {
726 nHeaderFooterType = 2; // even page footer
727 break;
728 }
729 case word::WdSeekView::wdSeekPrimaryFooter:
730 {
731 nHeaderFooterType = 3; // odd page footer
732 break;
733 }
734 case word::WdSeekView::wdSeekFirstPageHeader:
735 case word::WdSeekView::wdSeekFirstPageFooter:
736 {
737 uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
738 OUString aPageStyleName;
739 xCursorProps->getPropertyValue("PageStyleName") >>= aPageStyleName;
740 bool bFirstPage = false;
741 if ( aPageStyleName == "First Page" )
742 bFirstPage = true;
743 if( nView == word::WdSeekView::wdSeekFirstPageHeader )
744 {
745 if( bFirstPage )
746 nHeaderFooterType = 4;
747 else
748 nHeaderFooterType = 1;
749 }
750 else
751 {
752 if( bFirstPage )
753 nHeaderFooterType = 5;
754 else
755 nHeaderFooterType = 3;
756 }
757 break;
758 }
759 default:
760 {
761 nHeaderFooterType = -1;
762 }
763 }
764 result <<= nHeaderFooterType;
765 break;
766 }
767 default:
768 throw uno::RuntimeException("Not implemented" );
769 }
770 return result;
771}
772
773void SAL_CALL SwVbaSelection::InsertBreak( const uno::Any& _breakType )
774{
775 getRange()->InsertBreak( _breakType );
776}
777
778uno::Any SAL_CALL
780{
781 // Hacky implementation due to missing api ( and lack of knowledge )
782 // we can only support a selection that is a single table
783 if ( !aIndex.hasValue() ) // currently we can't support multiple tables in a selection
784 throw uno::RuntimeException();
785
786 sal_Int32 nIndex = 0;
787 aIndex >>= nIndex;
788
789 uno::Any aRet;
790
791 if ( nIndex != 1 )
792 throw uno::RuntimeException();
793
794 uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
795 uno::Reference< text::XTextTable > xTextTable;
796 xCursorProps->getPropertyValue("TextTable") >>= xTextTable;
797 if( xTextTable.is() )
798 {
799 uno::Reference< css::text::XTextDocument > xTextDoc( mxModel, uno::UNO_QUERY_THROW );
800 uno::Reference< word::XTable > xVBATable = new SwVbaTable( mxParent, mxContext, xTextDoc, xTextTable );
801 aRet <<= xVBATable;
802 return aRet;
803 }
804
805 // if the current selection is a XTextTableCursor and the index is 1 then we can service this request, otherwise we just have to throw
806 uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
807 SwXTextTableCursor* pTTCursor = dynamic_cast< SwXTextTableCursor* >( xTextTableCursor.get() );
808 if ( pTTCursor )
809 {
810 SwFrameFormat* pFormat = pTTCursor->GetFrameFormat();
811 if ( pFormat )
812 {
813 uno::Reference< text::XTextTable > xTable = SwXTextTables::GetObject(*pFormat);
814 uno::Reference< css::text::XTextDocument > xTextDoc( mxModel, uno::UNO_QUERY_THROW );
815 uno::Reference< word::XTable > xVBATable = new SwVbaTable( mxParent, mxContext, xTextDoc, xTable );
816 aRet <<= xVBATable;
817 }
818 }
819 return aRet;
820
821}
822
823uno::Any SAL_CALL
825{
826 uno::Reference< XCollection > xCol( new SwVbaFields( mxParent, mxContext, mxModel ) );
827 if ( index.hasValue() )
828 return xCol->Item( index, uno::Any() );
829 return uno::Any( xCol );
830}
831
832uno::Reference< word::XHeaderFooter > SAL_CALL
834{
836 {
837 uno::Reference< beans::XPropertySet > xPageStyleProps( word::getCurrentPageStyle( mxModel ), uno::UNO_QUERY_THROW );
838 sal_Int32 nIndex = word::WdHeaderFooterIndex::wdHeaderFooterPrimary;
839 bool isHeader = HeaderFooterHelper::isHeader( mxModel );
841 nIndex = word::WdHeaderFooterIndex::wdHeaderFooterEvenPages;
843 nIndex = word::WdHeaderFooterIndex::wdHeaderFooterFirstPage;
844
845 return uno::Reference< word::XHeaderFooter >( new SwVbaHeaderFooter( this, mxContext, mxModel, xPageStyleProps, isHeader, nIndex ) );
846
847 }
848 return uno::Reference< word::XHeaderFooter >();
849}
850
851uno::Any SAL_CALL
853{
854 uno::Reference< drawing::XShapes > xShapes( mxModel->getCurrentSelection(), uno::UNO_QUERY );
855 if ( !xShapes.is() )
856 {
857 uno::Reference< drawing::XShape > xShape( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
858 xShapes.set( drawing::ShapeCollection::create(mxContext) );
859 xShapes->add( xShape );
860 }
861
862 uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( mxModel, uno::UNO_QUERY_THROW );
863 uno::Reference< drawing::XDrawPage > xDrawPage = xDrawPageSupplier->getDrawPage();
864 uno::Reference< container::XIndexAccess > xShapesAccess( xShapes, uno::UNO_QUERY_THROW );
865 return uno::Any( uno::Reference< msforms::XShapeRange >( new ScVbaShapeRange( this, mxContext, xShapesAccess, xDrawPage, mxModel ) ) );
866}
867
868::sal_Int32 SAL_CALL SwVbaSelection::getStart()
869{
870 return getRange()->getStart();
871}
872
873void SAL_CALL SwVbaSelection::setStart( ::sal_Int32 _start )
874{
875 getRange()->setStart( _start );
876}
877::sal_Int32 SAL_CALL SwVbaSelection::getEnd()
878{
879 return getRange()->getEnd();
880}
881
882void SAL_CALL SwVbaSelection::setEnd( ::sal_Int32 _end )
883{
884 getRange()->setEnd( _end );
885}
886
888{
889 uno::Reference< word::XRows > xRows( Rows( uno::Any() ), uno::UNO_QUERY_THROW );
890 xRows->Select();
891}
892
894{
895 uno::Reference< word::XColumns > xColumns( Columns( uno::Any() ), uno::UNO_QUERY_THROW );
896 xColumns->Select();
897}
898
899uno::Any SAL_CALL SwVbaSelection::Rows( const uno::Any& index )
900{
901 OUString sTLName;
902 OUString sBRName;
903 GetSelectedCellRange( sTLName, sBRName );
904
905 sal_Int32 nStartRow = 0;
906 sal_Int32 nEndRow = 0;
907 uno::Reference< text::XTextTable > xTextTable = GetXTextTable();
908 SwVbaTableHelper aTableHelper( xTextTable );
909 nStartRow = aTableHelper.getTabRowIndex( sTLName );
910 if( !sBRName.isEmpty() )
911 {
912 nEndRow = aTableHelper.getTabRowIndex( sBRName );
913 }
914 else
915 {
916 nEndRow = nStartRow;
917 }
918
919 uno::Reference< XCollection > xCol( new SwVbaRows( this, mxContext, xTextTable, xTextTable->getRows(), nStartRow, nEndRow ) );
920 if ( index.hasValue() )
921 return xCol->Item( index, uno::Any() );
922 return uno::Any( xCol );
923}
924
926{
927 OUString sTLName;
928 OUString sBRName;
929 GetSelectedCellRange( sTLName, sBRName );
930 sal_Int32 nStartColumn = 0;
931 sal_Int32 nEndColumn = 0;
932
933 uno::Reference< text::XTextTable > xTextTable = GetXTextTable();
934 SwVbaTableHelper aTableHelper( xTextTable );
935 nStartColumn = aTableHelper.getTabColIndex( sTLName );
936 if( !sBRName.isEmpty() )
937 {
938 nEndColumn = aTableHelper.getTabColIndex( sBRName );
939 }
940 else
941 {
942 nEndColumn = nStartColumn;
943 }
944
945 uno::Reference< XCollection > xCol( new SwVbaColumns( this, mxContext, xTextTable, xTextTable->getColumns(), nStartColumn, nEndColumn ) );
946 if ( index.hasValue() )
947 return xCol->Item( index, uno::Any() );
948 return uno::Any( xCol );
949}
950
951uno::Reference< text::XTextTable > SwVbaSelection::GetXTextTable() const
952{
953 uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
954 uno::Reference< text::XTextTable > xTextTable;
955 xCursorProps->getPropertyValue("TextTable") >>= xTextTable;
956 return xTextTable;
957}
958
960{
961 uno::Reference< text::XTextTable > xTextTable = GetXTextTable();
962 return xTextTable.is();
963}
964
966{
967 uno::Reference< text::XTextRange > xStart = mxTextViewCursor->getStart();
968 uno::Reference< text::XTextRange > xEnd = mxTextViewCursor->getEnd();
969 uno::Reference< text::XTextRangeCompare > xTRC( mxTextViewCursor->getText(), uno::UNO_QUERY_THROW );
970 return xTRC->compareRegionStarts( xStart, xEnd ) != 0 || xTRC->compareRegionEnds( xStart, xEnd ) != 0;
971}
972
973void SwVbaSelection::GetSelectedCellRange( OUString& sTLName, OUString& sBRName )
974{
975 uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW );
976 uno::Reference< text::XTextTable > xTextTable;
977 xCursorProps->getPropertyValue("TextTable") >>= xTextTable;
978 if( !xTextTable.is() )
979 throw uno::RuntimeException( );
980
981 uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY );
982 if( xTextTableCursor.is() )
983 {
984 const OUString sRange( xTextTableCursor->getRangeName() );
985 if (!sRange.isEmpty())
986 {
987 sal_Int32 nIdx{0};
988 sTLName = sRange.getToken(0, ':', nIdx);
989 sBRName = sRange.getToken(0, ':', nIdx);
990 }
991 }
992 if( sTLName.isEmpty() )
993 {
994 uno::Reference< table::XCell > xCell;
995 xCursorProps->getPropertyValue("Cell") >>= xCell;
996 if( !xCell.is() )
997 {
998 throw uno::RuntimeException( );
999 }
1000 uno::Reference< beans::XPropertySet > xCellProps( xCell, uno::UNO_QUERY_THROW );
1001 xCellProps->getPropertyValue("CellName") >>= sTLName;
1002 }
1003}
1004
1006{
1007 OUString sTLName;
1008 OUString sBRName;
1009 GetSelectedCellRange( sTLName, sBRName );
1010 sal_Int32 nLeft = 0;
1011 sal_Int32 nTop = 0;
1012 sal_Int32 nRight = 0;
1013 sal_Int32 nBottom = 0;
1014
1015 uno::Reference< text::XTextTable > xTextTable = GetXTextTable();
1016 SwVbaTableHelper aTableHelper( xTextTable );
1017 nLeft = aTableHelper.getTabColIndex( sTLName );
1018 nTop = aTableHelper.getTabRowIndex( sTLName );
1019 if( !sBRName.isEmpty() )
1020 {
1021 nRight = aTableHelper.getTabColIndex( sBRName );
1022 nBottom = aTableHelper.getTabRowIndex( sBRName );
1023 }
1024 else
1025 {
1026 nRight = nLeft;
1027 nBottom = nTop;
1028 }
1029
1030 uno::Reference< XCollection > xCol( new SwVbaCells( this, mxContext, xTextTable, nLeft, nTop, nRight, nBottom ) );
1031 if ( index.hasValue() )
1032 return xCol->Item( index, uno::Any() );
1033 return uno::Any( xCol );
1034}
1035
1036void SAL_CALL SwVbaSelection::Copy( )
1037{
1038 dispatchRequests( mxModel,".uno:Copy" );
1039}
1040
1042{
1043 // seems not support in Writer
1044 Copy();
1045}
1046
1048{
1049 dispatchRequests( mxModel,".uno:Paste" );
1050}
1051
1052void SAL_CALL SwVbaSelection::Collapse( const uno::Any& Direction )
1053{
1055 return;
1056
1057 sal_Int32 nDirection = word::WdCollapseDirection::wdCollapseStart;
1058 if( Direction.hasValue() )
1059 Direction >>= nDirection;
1060
1061 uno::Reference< text::XTextViewCursor > xTextViewCursor = word::getXTextViewCursor( mxModel );
1062 if( nDirection == word::WdCollapseDirection::wdCollapseStart )
1063 {
1064 // it is inaccurate if current selection is multiple cells, so it needs to go to start
1065 uno::Reference< text::XTextRange > xTextRange = mxTextViewCursor->getStart();
1066 xTextViewCursor->gotoRange( xTextRange, false );
1067 xTextViewCursor->collapseToStart();
1068 }
1069 else if( nDirection == word::WdCollapseDirection::wdCollapseEnd )
1070 {
1071 uno::Reference< text::XTextRange > xTextRange = mxTextViewCursor->getEnd();
1072 xTextViewCursor->gotoRange( xTextRange, false );
1073 xTextViewCursor->collapseToEnd();
1074 }
1075 else
1076 {
1077 throw uno::RuntimeException();
1078 }
1079}
1080
1082{
1083 uno::Reference< text::XText > xText = word::getCurrentXText( mxModel );
1084 // FIXME: for i#7747,if the first line is a table, it fails to select all the contents in the story.
1085 // Temporary solution, insert an empty line before the table so that it could select all the contents.
1086 uno::Reference< container::XEnumerationAccess > xParaAccess( xText, uno::UNO_QUERY_THROW );
1087 uno::Reference< container::XEnumeration> xParaEnum = xParaAccess->createEnumeration();
1088 if( xParaEnum->hasMoreElements() )
1089 {
1090 uno::Reference< text::XTextTable > xTextTable( xParaEnum->nextElement(), uno::UNO_QUERY );
1091 if( xTextTable.is() )
1092 {
1093 // insert an empty line
1094 uno::Reference< text::XTextRange > xFirstCellRange = word::getFirstObjectPosition( xText );
1095 mxTextViewCursor->gotoRange( xFirstCellRange, false );
1096 dispatchRequests( mxModel,".uno:InsertPara" );
1097 }
1098 }
1099 uno::Reference< text::XTextRange > xStart = xText->getStart();
1100 uno::Reference< text::XTextRange > xEnd = xText->getEnd();
1101 mxTextViewCursor->gotoRange( xStart, false );
1102 mxTextViewCursor->gotoRange( xEnd, true );
1103}
1104
1105sal_Bool SAL_CALL SwVbaSelection::InRange( const uno::Reference< ::ooo::vba::word::XRange >& Range )
1106{
1107 return getRange()->InRange( Range );
1108}
1109
1111{
1112 if( !IsInTable() )
1113 throw uno::RuntimeException();
1114
1115 SwDocShell* pDocShell = word::getDocShell( mxModel );
1116 if( pDocShell )
1117 {
1118 if (SwFEShell* pFEShell = pDocShell->GetFEShell())
1119 pFEShell->SplitTable( SplitTable_HeadlineOption::ContentCopy );
1120 }
1121}
1122
1123uno::Any SAL_CALL
1125{
1126 // Hacky implementation due to missing api ( and lack of knowledge )
1127 // we can only support a selection that is a single paragraph
1128 if ( !aIndex.hasValue() ) // currently we can't support multiple paragraphs in a selection
1129 throw uno::RuntimeException();
1130
1131 sal_Int32 nIndex = 0;
1132 aIndex >>= nIndex;
1133
1134 uno::Any aRet;
1135
1136 if ( nIndex != 1 )
1137 throw uno::RuntimeException();
1138
1139 uno::Reference< text::XTextRange > xTextRange = mxTextViewCursor->getStart();
1140 uno::Reference< text::XText > xText = xTextRange->getText();
1141 uno::Reference< text::XParagraphCursor > xParaCursor( xText->createTextCursor(), uno::UNO_QUERY_THROW );
1142 xParaCursor->gotoStartOfParagraph( false );
1143 xParaCursor->gotoStartOfParagraph( true );
1144
1145 uno::Reference< text::XTextDocument > xTextDoc( mxModel, uno::UNO_QUERY_THROW );
1146 uno::Reference< text::XTextRange > xParaRange( xParaCursor, uno::UNO_QUERY_THROW );
1147 uno::Reference< word::XParagraph > xParagraph = new SwVbaParagraph( mxParent, mxContext, xTextDoc, xParaRange );
1148
1149 aRet <<= xParagraph;
1150 return aRet;
1151}
1152
1153OUString
1155{
1156 return "SwVbaSelection";
1157}
1158
1159uno::Sequence< OUString >
1161{
1162 static uno::Sequence< OUString > const aServiceNames
1163 {
1164 "ooo.vba.word.Selection"
1165 };
1166 return aServiceNames;
1167}
1168
1169/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::frame::XModel2 > mxModel
static bool isEvenPagesHeader(const css::uno::Reference< css::frame::XModel > &xModel)
static bool isEvenPagesFooter(const css::uno::Reference< css::frame::XModel > &xModel)
static bool isHeader(const css::uno::Reference< css::frame::XModel > &xModel)
static bool isFirstPageFooter(const css::uno::Reference< css::frame::XModel > &xModel)
static bool isHeaderFooter(const css::uno::Reference< css::frame::XModel > &xModel)
static bool isFirstPageHeader(const css::uno::Reference< css::frame::XModel > &xModel)
css::uno::Reference< css::uno::XComponentContext > mxContext
css::uno::WeakReference< ov::XHelperInterface > mxParent
virtual css::uno::Any SAL_CALL Application() override
SwFEShell * GetFEShell()
For Core - it knows the DocShell but not the WrtShell!
Definition: docsh.cxx:1223
Style of a layout element.
Definition: frmfmt.hxx:72
static css::uno::Reference< ooo::vba::word::XFind > GetOrCreateFind(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< com::sun::star::uno::XComponentContext > &rContext, const css::uno::Reference< com::sun::star::frame::XModel > &xModel, const css::uno::Reference< css::text::XTextRange > &xTextRange)
Definition: vbafind.cxx:47
static sal_Int32 handleWdActiveEndPageNumber(const css::uno::Reference< css::text::XTextViewCursor > &xTVCursor)
static sal_Int32 handleWdNumberOfPagesInDocument(const css::uno::Reference< css::frame::XModel > &xModel)
static double handleWdVerticalPositionRelativeToPage(const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Reference< css::text::XTextViewCursor > &xTVCursor)
virtual css::uno::Any SAL_CALL Paragraphs(const css::uno::Any &aIndex) override
virtual void SAL_CALL Collapse(const css::uno::Any &Direction) override
virtual void SAL_CALL SelectColumn() override
virtual void SAL_CALL WholeStory() override
virtual void SAL_CALL InsertParagraphBefore() override
css::uno::Reference< css::frame::XModel > mxModel
virtual css::uno::Reference< ooo::vba::word::XHeaderFooter > SAL_CALL getHeaderFooter() override
virtual void SAL_CALL setStart(::sal_Int32 _start) override
virtual void SAL_CALL MoveDown(const css::uno::Any &_unit, const css::uno::Any &_count, const css::uno::Any &_extend) override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual void SAL_CALL Copy() override
virtual void SAL_CALL setText(const OUString &rText) override
virtual void SAL_CALL Paste() override
virtual css::uno::Any SAL_CALL Fields(const css::uno::Any &aIndex) override
virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() override
virtual ::sal_Int32 SAL_CALL getLanguageID() override
virtual css::uno::Reference< ooo::vba::word::XRange > SAL_CALL getRange() override
virtual void SAL_CALL CopyAsPicture() override
virtual void SAL_CALL TypeText(const OUString &rText) override
virtual css::uno::Reference< ooo::vba::word::XRange > SAL_CALL GoTo(const css::uno::Any &_what, const css::uno::Any &_which, const css::uno::Any &_count, const css::uno::Any &_name) override
void Move(const css::uno::Any &_unit, const css::uno::Any &_count, const css::uno::Any &_extend, ooo::vba::word::E_DIRECTION eDirection)
virtual ~SwVbaSelection() override
virtual ::sal_Int32 SAL_CALL getEnd() override
virtual void SAL_CALL TypeParagraph() override
virtual void SAL_CALL setParagraphFormat(const css::uno::Reference< ooo::vba::word::XParagraphFormat > &rParagraphFormat) override
virtual css::uno::Any SAL_CALL getStyle() override
css::uno::Reference< css::text::XTextViewCursor > mxTextViewCursor
virtual sal_Bool SAL_CALL InRange(const css::uno::Reference< ::ooo::vba::word::XRange > &Range) override
virtual void SAL_CALL EndKey(const css::uno::Any &_unit, const css::uno::Any &_extend) override
virtual css::uno::Any SAL_CALL Information(sal_Int32 _type) override
virtual void SAL_CALL HomeKey(const css::uno::Any &_unit, const css::uno::Any &_extend) override
virtual css::uno::Any SAL_CALL Rows(const css::uno::Any &aIndex) override
virtual void SAL_CALL SplitTable() override
virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() override
virtual css::uno::Reference< ooo::vba::word::XFind > SAL_CALL getFind() override
css::uno::Reference< css::text::XTextTable > GetXTextTable() const
virtual css::uno::Any SAL_CALL Cells(const css::uno::Any &aIndex) override
virtual void SAL_CALL InsertBreak(const css::uno::Any &_breakType) override
bool IsInTable() const
virtual void SAL_CALL SelectRow() override
virtual void SAL_CALL MoveLeft(const css::uno::Any &_unit, const css::uno::Any &_count, const css::uno::Any &_extend) override
virtual css::uno::Any SAL_CALL ShapeRange() override
virtual void SAL_CALL TypeBackspace() override
virtual void SAL_CALL setStyle(const css::uno::Any &_xStyle) override
virtual css::uno::Any SAL_CALL Columns(const css::uno::Any &aIndex) override
css::uno::Reference< css::text::XTextRange > GetSelectedRange()
virtual void SAL_CALL setLanguageID(::sal_Int32 _languageid) override
virtual OUString getServiceImplName() override
virtual css::uno::Any SAL_CALL Tables(const css::uno::Any &aIndex) override
virtual void SAL_CALL setEnd(::sal_Int32 _end) override
SwVbaSelection(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, css::uno::Reference< css::frame::XModel > xModel)
void NextCell(sal_Int32 nCount, ooo::vba::word::E_DIRECTION eDirection)
void GetSelectedCellRange(OUString &sTLName, OUString &sBRName)
virtual void SAL_CALL Delete(const css::uno::Any &_unit, const css::uno::Any &_count) override
virtual void SAL_CALL InsertParagraphAfter() override
virtual void SAL_CALL MoveUp(const css::uno::Any &_unit, const css::uno::Any &_count, const css::uno::Any &_extend) override
virtual void SAL_CALL InsertParagraph() override
virtual OUString SAL_CALL getText() override
virtual void SAL_CALL MoveRight(const css::uno::Any &_unit, const css::uno::Any &_count, const css::uno::Any &_extend) override
virtual ::sal_Int32 SAL_CALL getStart() override
static void setStyle(const css::uno::Reference< css::beans::XPropertySet > &xParaProps, const css::uno::Any &xStyle)
Definition: vbastyle.cxx:94
sal_Int32 getTabColIndex(const OUString &sCellName)
sal_Int32 getTabRowIndex(const OUString &sCellName)
SwFrameFormat * GetFrameFormat() const
Definition: unotbl.hxx:234
static css::uno::Reference< css::text::XTextTable > GetObject(SwFrameFormat &rFormat)
Definition: unocoll.cxx:988
int nCount
std::deque< AttacherIndex_Impl > aIndex
Sequence< OUString > aServiceNames
OUString sName
sal_Int32 nIndex
sal_Int64 n
int i
index
uno::Reference< text::XTextViewCursor > getXTextViewCursor(const uno::Reference< frame::XModel > &xModel)
bool gotoSelectedObjectAnchor(const uno::Reference< frame::XModel > &xModel)
uno::Reference< text::XText > getCurrentXText(const uno::Reference< frame::XModel > &xModel)
uno::Reference< text::XTextRange > getFirstObjectPosition(const uno::Reference< text::XText > &xText)
SwDocShell * getDocShell(const uno::Reference< frame::XModel > &xModel)
uno::Reference< style::XStyle > getCurrentPageStyle(const uno::Reference< frame::XModel > &xModel)
sal_Int32 getPageCount(const uno::Reference< frame::XModel > &xModel)
VBAHELPER_DLLPUBLIC void dispatchRequests(const css::uno::Reference< css::frame::XModel > &xModel, const OUString &aUrl)
#define ERRCODE_BASIC_BAD_ARGUMENT
bool hasValue()
Reference< XModel > xModel
unsigned char sal_Bool
Any result