Kaydet (Commit) 09abd826 authored tarafından Thomas Arnhold's avatar Thomas Arnhold

remove uncompiled source files

how to find possible candidates:

find . -name *.cxx | grep -v compilerplugins > cxx.list
for i in `cat cxx.list`; do basename $i .cxx; done > cxx.base.list
for i in `cat cxx.base.list | sort -u`; do echo $(git grep -w $i -- '*.mk' | wc -l) $i; done > cxx.count

Change-Id: I15c6cc7195e58d79967388850a0c90b915b001b7
üst c2d7ee9a
/* -*- 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 .
*/
#define _TLBIGINT_INT64
#include <tools/bigint.hxx>
#include <basic/sbx.hxx>
///////////////////////////// BigInt/Currency
SbxValues::SbxValues( const BigInt &rBig ) : eType(SbxCURRENCY)
{
rBig.INT64( &nLong64 );
}
//TODO: BigInt is TOOLS_DLLPUBLIC, and its four member functions only declared
// and defined within basic (#define _TLBIGINT_INT64) are a bad hack that causes
// "warning C4273: 'function' : inconsistent dll linkage" on MSC; this whole
// mess should be cleaned up properly (e.g., by completely removing Sbx[U]INT64
// and using sal_[u]Int64 instead):
#if defined _MSC_VER
#pragma warning(disable: 4273)
#endif
sal_Bool BigInt::INT64( SbxINT64 *p ) const
{
if( bIsBig ) {
if( nLen > 4 || (nNum[3] & 0x8000) )
return sal_False;
p->nLow = ((sal_uInt32)nNum[1] << 16) | (sal_uInt32)nNum[0];
p->nHigh = ((sal_uInt32)nNum[3] << 16) | (sal_uInt32)nNum[2];
if( bIsNeg )
p->CHS();
}
else
p->Set( (sal_Int32)nVal );
return sal_True;
}
BigInt::BigInt( const SbxINT64 &r )
{
BigInt a10000 = 0x10000;
*this = r.nHigh;
if( r.nHigh )
*this *= a10000;
*this += (sal_uInt16)(r.nLow >> 16);
*this *= a10000;
*this += (sal_uInt16)r.nLow;
}
sal_Bool BigInt::UINT64( SbxUINT64 *p ) const
{
if( bIsBig ) {
if( bIsNeg || nLen > 4 )
return sal_False;
p->nLow = ((sal_uInt32)nNum[1] << 16) | (sal_uInt32)nNum[0];
p->nHigh = ((sal_uInt32)nNum[3] << 16) | (sal_uInt32)nNum[2];
}
else {
if( nVal < 0 )
return sal_False;
p->Set( (sal_uInt32)nVal );
}
return sal_True;
}
BigInt::BigInt( const SbxUINT64 &r )
{
BigInt a10000 = 0x10000;
*this = BigInt(r.nHigh);
if( r.nHigh )
*this *= a10000;
*this += (sal_uInt16)(r.nLow >> 16);
*this *= a10000;
*this += (sal_uInt16)r.nLow;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 <cppuhelper/implementationentry.hxx>
#include "ChartView.hxx"
static const struct ::cppu::ImplementationEntry g_entries_chart2_view[] =
{
{
::chart::ChartView::create
, ::chart::ChartView::getImplementationName_Static
, ::chart::ChartView::getSupportedServiceNames_Static
, ::cppu::createSingleComponentFactory
, 0
, 0
}
,{ 0, 0, 0, 0, 0, 0 }
};
// component exports
extern "C"
{
SAL_DLLPUBLIC_EXPORT void * SAL_CALL chartview_component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
return ::cppu::component_getFactoryHelper(
pImplName, pServiceManager, pRegistryKey , g_entries_chart2_view );
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#define LOCAL
#define UNICODE
#include "wrapper.h"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
int MainW();
#ifdef __cplusplus
} /* extern "C" */
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#define REMOTE
#define UNICODE
#include "wrapper.h"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
#include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
#endif
#include "main.h"
int APIENTRY WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
{
return MainW();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#pragma once
#ifndef __cplusplus
#error Need C++ to compile
#endif
#include "main.h"
#ifndef _WINDOWS_
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
# include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
#endif
#endif
#ifndef _INC_TCHAR
# ifdef UNICODE
# define _UNICODE
# endif
# include <tchar.h>
#endif
#ifdef UNICODE
# define Main MainW
# define GetArgv( pArgc ) CommandLineToArgvW( GetCommandLine(), pArgc )
# define PROCESS_CREATIONFLAGS CREATE_UNICODE_ENVIRONMENT
#else
# define GetArgv( pArgc ) (*pArgc = __argc, __argv)
# define PROCESS_CREATIONFLAGS 0
# define Main MainA
#endif
#define BIN_EXT_STR TEXT(".bin")
#define PARAM_LIBPATH_STR TEXT("-libpath=")
#define PARAM_LOCAL_STR TEXT("-local")
#define PARAM_REMOTE_STR TEXT("-remote")
#if defined( REMOTE )
#define DEFAULT_LIBPATH TEXT("remote;")
#elif defined( LOCAL )
#define DEFAULT_LIBPATH TEXT("local;")
#endif
extern "C" int Main()
{
// Retrieve startup info
STARTUPINFO aStartupInfo;
ZeroMemory( &aStartupInfo, sizeof(aStartupInfo) );
aStartupInfo.cb = sizeof( aStartupInfo );
GetStartupInfo( &aStartupInfo );
// Retrieve command line
LPTSTR lpCommandLine = GetCommandLine();
LPTSTR *ppArguments = NULL;
int nArguments = 0;
ppArguments = GetArgv( &nArguments );
// Calculate application name
TCHAR szApplicationName[MAX_PATH];
TCHAR szDrive[MAX_PATH];
TCHAR szDir[MAX_PATH];
TCHAR szFileName[MAX_PATH];
TCHAR szExt[MAX_PATH];
GetModuleFileName( NULL, szApplicationName, MAX_PATH );
_tsplitpath( szApplicationName, szDrive, szDir, szFileName, szExt );
_tmakepath( szApplicationName, szDrive, szDir, szFileName, BIN_EXT_STR );
// Retrieve actual environment
TCHAR szBuffer[1024];
TCHAR szPathValue[1024] = TEXT("");
#ifdef DEFAULT_LIBPATH
_tmakepath( szPathValue, szDrive, szDir, DEFAULT_LIBPATH, TEXT("") );
#endif
for ( int argn = 1; argn < nArguments; argn++ )
{
if ( 0 == _tcscmp( ppArguments[argn], PARAM_REMOTE_STR ) )
{
_tmakepath( szPathValue, szDrive, szDir, TEXT("remote;"), TEXT("") );
break;
}
else if ( 0 == _tcscmp( ppArguments[argn], PARAM_LOCAL_STR ) )
{
_tmakepath( szPathValue, szDrive, szDir, TEXT("local;"), TEXT("") );
break;
}
else if ( 0 == _tcsncmp( ppArguments[argn], PARAM_LIBPATH_STR, _tcslen(PARAM_LIBPATH_STR) ) )
{
LPTSTR pFileSpec = NULL;
GetFullPathName( ppArguments[argn] + _tcslen(PARAM_LIBPATH_STR), sizeof(szPathValue) / sizeof(TCHAR), szPathValue, &pFileSpec );
_tcscat( szPathValue, TEXT(";") );
break;
}
}
GetEnvironmentVariable( TEXT("PATH"), szBuffer, sizeof(szBuffer) );
_tcscat( szPathValue, szBuffer );
SetEnvironmentVariable( TEXT("PATH"), szPathValue);
LPVOID lpEnvironment = GetEnvironmentStrings();
// Retrieve current directory
TCHAR szCurrentDirectory[MAX_PATH];
GetCurrentDirectory( MAX_PATH, szCurrentDirectory );
// Set the Flags
DWORD dwCreationFlags = PROCESS_CREATIONFLAGS;
PROCESS_INFORMATION aProcessInfo;
BOOL fSuccess = CreateProcess(
szApplicationName,
lpCommandLine,
NULL,
NULL,
TRUE,
dwCreationFlags,
lpEnvironment,
szCurrentDirectory,
&aStartupInfo,
&aProcessInfo );
if ( fSuccess )
{
DWORD dwExitCode;
WaitForSingleObject( aProcessInfo.hProcess, INFINITE );
fSuccess = GetExitCodeProcess( aProcessInfo.hProcess, &dwExitCode );
return dwExitCode;
}
DWORD dwError = GetLastError();
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dwError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR)&lpMsgBuf,
0,
NULL
);
// Display the string.
MessageBox( NULL, (LPCTSTR)lpMsgBuf, NULL, MB_OK | MB_ICONERROR );
// Free the buffer.
LocalFree( lpMsgBuf );
return GetLastError();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#define UNICODE
#include "wrapper.h"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_SC_SOURCE_FILTER_INC_XCL97DUM_HXX
#define INCLUDED_SC_SOURCE_FILTER_INC_XCL97DUM_HXX
#include "excrecds.hxx"
// --- class ExcDummy8_xx --------------------------------------------
class ExcDummy8_00a : public ExcDummyRec
{
private:
static const sal_uInt8 pMyData[];
static const sal_Size nMyLen;
public:
virtual sal_Size GetLen() const;
virtual const sal_uInt8* GetData() const;
};
class ExcDummy8_00b : public ExcDummyRec
{
private:
static const sal_uInt8 pMyData[];
static const sal_Size nMyLen;
public:
virtual sal_Size GetLen() const;
virtual const sal_uInt8* GetData() const;
};
class ExcDummy8_040 : public ExcDummyRec
{
private:
static const sal_uInt8 pMyData[];
static const sal_Size nMyLen;
public:
virtual sal_Size GetLen() const;
virtual const sal_uInt8* GetData() const;
};
class ExcDummy8_041 : public ExcDummyRec
{
private:
static const sal_uInt8 pMyData[];
static const sal_Size nMyLen;
public:
virtual sal_Size GetLen() const;
virtual const sal_uInt8* GetData() const;
};
class ExcDummy8_02 : public ExcDummyRec
{
private:
static const sal_uInt8 pMyData[];
static const sal_Size nMyLen;
public:
virtual sal_Size GetLen() const;
virtual const sal_uInt8* GetData() const;
};
#endif // _XCL97DUM_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "xcl97dum.hxx"
// --- ExcDummy8_xx Data ---------------------------------------------
// ... (8+) := neu in Biff8, ... (8*) := anders in Biff8
const sal_uInt8 ExcDummy8_00a::pMyData[] = {
0xe1, 0x00, 0x02, 0x00, 0xb0, 0x04, // INTERFACEHDR
0xc1, 0x00, 0x02, 0x00, 0x00, 0x00, // MMS
0xe2, 0x00, 0x00, 0x00, // INTERFACEEND
0x5c, 0x00, 0x70, 0x00, // WRITEACCESS (8*)
0x04, 0x00, 0x00, 'C', 'a', 'l', 'c', 0x20, // "Calc"
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x42, 0x00, 0x02, 0x00, 0xb0, 0x04, // CODEPAGE
0x61, 0x01, 0x02, 0x00, 0x00, 0x00 // DSF (8+)
};
const sal_Size ExcDummy8_00a::nMyLen = sizeof(ExcDummy8_00a::pMyData);
// TABID (8+): ExcTabid
const sal_uInt8 ExcDummy8_00b::pMyData[] = {
0x9c, 0x00, 0x02, 0x00, 0x0e, 0x00 // FNGROUPCOUNT
};
const sal_Size ExcDummy8_00b::nMyLen = sizeof(ExcDummy8_00b::pMyData);
const sal_uInt8 ExcDummy8_040::pMyData[] = {
0xaf, 0x01, 0x02, 0x00, 0x00, 0x00, // PROT4REV (8+)
0xbc, 0x01, 0x02, 0x00, 0x00, 0x00, // PROT4REVPASS (8+)
// 0x3d, 0x00, 0x12, 0x00, 0xe0, 0x01, 0x5a, 0x00, 0xcf, // WINDOW1
// 0x3f, 0x4e, 0x2a, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0x01, 0x00, 0x58, 0x02,
0x40, 0x00, 0x02, 0x00, 0x00, 0x00, // BACKUP
0x8d, 0x00, 0x02, 0x00, 0x00, 0x00 // HIDEOBJ
};
const sal_Size ExcDummy8_040::nMyLen = sizeof(ExcDummy8_040::pMyData);
const sal_uInt8 ExcDummy8_041::pMyData[] = {
0xb7, 0x01, 0x02, 0x00, 0x00, 0x00, // REFRESHALL (8+)
0xda, 0x00, 0x02, 0x00, 0x00, 0x00 // BOOKBOOL
};
const sal_Size ExcDummy8_041::nMyLen = sizeof(ExcDummy8_041::pMyData);
const sal_uInt8 ExcDummy8_02::pMyData[] = {
0x5f, 0x00, 0x02, 0x00, 0x01, 0x00 // SAVERECALC
};
const sal_Size ExcDummy8_02::nMyLen = sizeof(ExcDummy8_02::pMyData);
// --- class ExcDummy8_xx --------------------------------------------
sal_Size ExcDummy8_00a::GetLen() const
{
return nMyLen;
}
const sal_uInt8* ExcDummy8_00a::GetData() const
{
return pMyData;
}
sal_Size ExcDummy8_00b::GetLen() const
{
return nMyLen;
}
const sal_uInt8* ExcDummy8_00b::GetData() const
{
return pMyData;
}
sal_Size ExcDummy8_040::GetLen() const
{
return nMyLen;
}
const sal_uInt8* ExcDummy8_040::GetData() const
{
return pMyData;
}
sal_Size ExcDummy8_041::GetLen() const
{
return nMyLen;
}
const sal_uInt8* ExcDummy8_041::GetData() const
{
return pMyData;
}
sal_Size ExcDummy8_02::GetLen() const
{
return nMyLen;
}
const sal_uInt8* ExcDummy8_02::GetData() const
{
return pMyData;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "sal/config.h"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "cppuhelper/implbase1.hxx"
#include "com/sun/star/office/XAnnotationAccess.hpp"
class AnnotationAccess:
public ::cppu::WeakImplHelper1<
css::office::XAnnotationAccess>
{
public:
explicit AnnotationAccess(css::uno::Reference< css::uno::XComponentContext > const & context);
// ::com::sun::star::office::XAnnotationAccess:
virtual css::uno::Reference< css::office::XAnnotation > SAL_CALL createAndInsertAnnotation() throw (css::uno::RuntimeException);
virtual void SAL_CALL removeAnnotation(const css::uno::Reference< css::office::XAnnotation > & annotation) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException);
virtual css::uno::Reference< css::office::XAnnotationEnumeration > SAL_CALL createAnnotationEnumeration() throw (css::uno::RuntimeException);
private:
AnnotationAccess(const AnnotationAccess &); // not defined
AnnotationAccess& operator=(const AnnotationAccess &); // not defined
// destructor is private and will be called indirectly by the release call virtual ~AnnotationAccess() {}
css::uno::Reference< css::uno::XComponentContext > m_xContext;
};
AnnotationAccess::AnnotationAccess(css::uno::Reference< css::uno::XComponentContext > const & context) :
m_xContext(context)
{}
// ::com::sun::star::office::XAnnotationAccess:
css::uno::Reference< css::office::XAnnotation > SAL_CALL AnnotationAccess::createAndInsertAnnotation() throw (css::uno::RuntimeException)
{
// TODO: Exchange the default return implementation for "createAndInsertAnnotation" !!!
// Exchange the default return implementation.
// NOTE: Default initialized polymorphic structs can cause problems because of
// missing default initialization of primitive types of some C++ compilers or
// different Any initialization in Java and C++ polymorphic structs.
return css::uno::Reference< css::office::XAnnotation >();
}
void SAL_CALL AnnotationAccess::removeAnnotation(const css::uno::Reference< css::office::XAnnotation > & annotation) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException)
{
// TODO: Insert your implementation for "removeAnnotation" here.
}
css::uno::Reference< css::office::XAnnotationEnumeration > SAL_CALL AnnotationAccess::createAnnotationEnumeration() throw (css::uno::RuntimeException)
{
// TODO: Exchange the default return implementation for "createAnnotationEnumeration" !!!
// Exchange the default return implementation.
// NOTE: Default initialized polymorphic structs can cause problems because of
// missing default initialization of primitive types of some C++ compilers or
// different Any initialization in Java and C++ polymorphic structs.
return css::uno::Reference< css::office::XAnnotationEnumeration >();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_SD_SOURCE_UI_INC_SLIDESORTERCHILDWINDOW_HXX
#define INCLUDED_SD_SOURCE_UI_INC_SLIDESORTERCHILDWINDOW_HXX
#include <sfx2/childwin.hxx>
namespace sd { namespace slidesorter {
/** The slide browser child window contains a slide sorter and is by
default shown to the left of the main edit area.
*/
class SlideSorterChildWindow
: public SfxChildWindow
{
public:
SlideSorterChildWindow (
::Window*,
sal_uInt16,
SfxBindings*,
SfxChildWinInfo*);
virtual ~SlideSorterChildWindow (void);
SFX_DECL_CHILDWINDOW (SlideBrowserChildWindow);
};
} } // end of namespaces ::sd::slidesorter
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "controller/SlsSlideFunction.hxx"
#include "SlideSorter.hxx"
#include "controller/SlideSorterController.hxx"
#include "view/SlideSorterView.hxx"
#include "model/SlideSorterModel.hxx"
namespace sd { namespace slidesorter { namespace controller {
TYPEINIT1(SlideFunction, FuPoor);
SlideFunction::SlideFunction (
SlideSorter& rSlideSorter,
SfxRequest& rRequest)
: FuPoor (
rSlideSorter.GetViewShell(),
rSlideSorter.GetContentWindow().get(),
&rSlideSorter.GetView(),
rSlideSorter.GetModel().GetDocument(),
rRequest)
{
}
sal_Bool SlideFunction::MouseMove(const MouseEvent& )
{
return sal_False;
}
sal_Bool SlideFunction::MouseButtonUp(const MouseEvent& )
{
return sal_False;
}
sal_Bool SlideFunction::MouseButtonDown(const MouseEvent& )
{
return sal_False;
}
} } } // end of namespace ::sd::slidesorter::controller
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_CONTROLLER_SLSSLIDEFUNCTION_HXX
#define INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_CONTROLLER_SLSSLIDEFUNCTION_HXX
#include "fupoor.hxx"
namespace sd { namespace slidesorter {
class SlideSorter;
} }
namespace sd { namespace slidesorter { namespace controller {
/** Base class for functions of the slide sorter.
*/
class SlideFunction
: public FuPoor
{
public:
TYPEINFO_OVERRIDE();
virtual sal_Bool MouseMove (const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonUp (const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown (const MouseEvent& rMEvt);
protected:
SlideFunction (
SlideSorter& rSlideSorter,
SfxRequest& rRequest);
};
} } } // end of namespace ::sd::slidesorter::controller
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "SlideSorterChildWindow.hxx"
#include "app.hrc"
#include "sfx2/app.hxx"
#include <sfx2/dockwin.hxx>
#include "SlideSorter.hxx"
namespace sd { namespace slidesorter {
SlideSorterChildWindow::SlideSorterChildWindow (
::Window* pParentWindow,
sal_uInt16 nId,
SfxBindings* pBindings,
SfxChildWinInfo* pInfo)
: SfxChildWindow (pParentWindow, nId)
{
pWindow = new SlideSorter (
pBindings,
this,
pParentWindow);
eChildAlignment = SFX_ALIGN_LEFT;
static_cast<SfxDockingWindow*>(pWindow)->Initialize (pInfo);
// SetHideNotDelete (sal_True);
}
SlideSorterChildWindow::~SlideSorterChildWindow (void)
{}
SFX_IMPL_DOCKINGWINDOW(SlideSorterChildWindow, SID_SLIDE_BROWSER)
} } // end of namespace ::sd::slidesorter
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "precompiled_sfx2.hxx"
#include "ContextMatcher.hxx"
#include "Context.hxx"
using ::rtl::OUString;
namespace sfx2 { namespace sidebar {
namespace {
static const sal_Char* gsAny = "any";
}
ContextMatcher::ContextMatcher (void)
: maEntries()
{
}
ContextMatcher::~ContextMatcher (void)
{
}
sal_Int32 ContextMatcher::EvaluateMatch (
const Context& rContext) const
{
sal_Int32 nBestMatch (Context::NoMatch);
for (::std::vector<Entry>::const_iterator
iEntry(maEntries.begin()),
iEnd(maEntries.end());
iEntry!=iEnd;
++iEntry)
{
const sal_Int32 nMatch (EvaluateMatch(rContext, *iEntry));
if (nMatch < nBestMatch)
nBestMatch = nMatch;
if (nBestMatch == Context::OptimalMatch)
break;
}
return nBestMatch;
}
sal_Int32 ContextMatcher::EvaluateMatch (
const Context& rContext,
const Entry& rEntry) const
{
sal_Int32 nApplicationMatch (Context::NoMatch);
if (rContext.msApplication.equals(rEntry.msApplicationName))
nApplicationMatch = 0;
else if (rEntry.msApplicationName.equalsAscii(gsAny))
nApplicationMatch = Context::ApplicationWildcardMatch;
else
return Context::NoMatch;
sal_Int32 nBestContextMatch (Context::NoMatch);
for (::std::vector<OUString>::const_iterator
iContext(rEntry.maContextNames.begin()),
iEnd(rEntry.maContextNames.end());
iContext!=iEnd;
++iContext)
{
sal_Int32 nContextMatch (Context::NoMatch);
if (rContext.msContext.equals(*iContext))
nContextMatch = 0;
else if (iContext->equalsAscii(gsAny))
nContextMatch = Context::ContextWildcardMatch;
else
continue;
if (nContextMatch < nBestContextMatch)
nBestContextMatch = nContextMatch;
}
if (rEntry.mbIsContextListNegated)
nBestContextMatch = Context::NoMatch - nBestContextMatch;
return nApplicationMatch + nBestContextMatch;
}
void ContextMatcher::AddMatcher (
const ::rtl::OUString& rsApplicationName,
const ::std::vector<rtl::OUString>& rContextNames,
const bool bIsContextListNegated)
{
maEntries.push_back(Entry());
maEntries.back().msApplicationName = rsApplicationName;
maEntries.back().maContextNames = rContextNames;
maEntries.back().mbIsContextListNegated = bIsContextListNegated;
}
void ContextMatcher::AddMatcher (
const ::rtl::OUString& rsApplicationName,
const ::rtl::OUString& rsContextName)
{
maEntries.push_back(Entry());
maEntries.back().msApplicationName = rsApplicationName;
maEntries.back().maContextNames.push_back(rsContextName);
maEntries.back().mbIsContextListNegated = false;
}
} } // end of namespace sfx2::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_CONTEXTMATCHER_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_CONTEXTMATCHER_HXX
#include <sal/types.h>
#include <rtl/ustring.hxx>
#include <vector>
namespace sfx2 { namespace sidebar {
class Context;
/** Data read from the configuration for matching contexts.
*/
class ContextMatcher
{
public:
ContextMatcher (void);
~ContextMatcher (void);
sal_Int32 EvaluateMatch (
const Context& rContext) const;
void AddMatcher (
const ::rtl::OUString& rsApplicationName,
const ::std::vector<rtl::OUString>& rContextNames,
const bool mbIsContextListNegated);
void AddMatcher (
const ::rtl::OUString& rsApplicationName,
const ::rtl::OUString& rsContextName);
private:
class Entry
{
public:
::rtl::OUString msApplicationName;
::std::vector<rtl::OUString> maContextNames;
bool mbIsContextListNegated;
};
::std::vector<Entry> maEntries;
sal_Int32 EvaluateMatch (
const Context& rContext,
const Entry& rEntry) const;
};
static bool IsMatchBetterThan (const sal_Int32 nMatchA, const sal_Int32 nMatchB);
} } // end of namespace sfx2::sidebar
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "precompiled_sfx2.hxx"
#include "DeckConfiguration.hxx"
#include "Deck.hxx"
namespace sfx2 { namespace sidebar {
DeckConfiguration::DeckConfiguration (void)
: mpDeck(NULL),
maPanels()
{
}
void DeckConfiguration::Dispose (void)
{
if (mpDeck != NULL)
{
mpDeck->Dispose();
Deck* pDeck = mpDeck;
mpDeck = NULL;
OSL_TRACE("deleting deck window subtree");
pDeck->PrintWindowTree();
delete pDeck;
}
}
} } // end of namespace sfx2::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_DECKCONFIGURATION_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_DECKCONFIGURATION_HXX
#include <vector>
namespace sfx2 { namespace sidebar {
class Deck;
class Panel;
class DeckConfiguration
{
public:
Deck* mpDeck;
::std::vector<Panel*> maPanels;
DeckConfiguration (void);
void Dispose (void);
};
} } // end of namespace sfx2::sidebar
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -21,7 +21,6 @@
#include "DeckTitleBar.hxx"
#include "Panel.hxx"
#include "PanelTitleBar.hxx"
#include "SidebarPanel.hxx"
#include "SidebarResource.hxx"
#include "TabBar.hxx"
#include <sfx2/sidebar/Theme.hxx>
......
/* -*- 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 "precompiled_sfx2.hxx"
#include "SidebarPanel.hxx"
#include "Panel.hxx"
#include <sfx2/sidebar/Theme.hxx>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <svl/smplhint.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/awt/XWindowPeer.hpp>
using namespace css;
using namespace cssu;
namespace sfx2 { namespace sidebar {
Reference<css::ui::XSidebarPanel> SidebarPanel::Create (Panel* pPanel)
{
return Reference<css::ui::XSidebarPanel>(new SidebarPanel(pPanel));
}
SidebarPanel::SidebarPanel(Panel* pPanel)
: SidebarPanelInterfaceBase(m_aMutex),
mpPanel(pPanel),
mxCanvas()
{
if (mpPanel != NULL)
mpPanel->AddEventListener(LINK(this, SidebarPanel, HandleWindowEvent));
else
{
mpPanel = NULL;
dispose();
}
}
SidebarPanel::~SidebarPanel (void)
{
}
void SAL_CALL SidebarPanel::disposing (const css::lang::EventObject& rEventObject)
throw(cssu::RuntimeException)
{
(void)rEventObject;
}
void SAL_CALL SidebarPanel::disposing (void)
{
if (mpPanel != NULL)
{
mpPanel->RemoveEventListener(LINK(this, SidebarPanel, HandleWindowEvent));
mpPanel = NULL;
}
}
cssu::Reference<css::rendering::XCanvas> SAL_CALL SidebarPanel::getCanvas (void)
throw (cssu::RuntimeException)
{
if ( ! mxCanvas.is())
{
Sequence<Any> aArg (5);
// common: first any is VCL pointer to window (for VCL canvas)
aArg[0] = makeAny(reinterpret_cast<sal_Int64>(mpPanel));
aArg[1] = Any();
aArg[2] = makeAny(::com::sun::star::awt::Rectangle());
aArg[3] = makeAny(sal_False);
aArg[4] = makeAny(mpPanel->GetComponentInterface());
css::uno::Reference<css::uno::XComponentContext> context(
comphelper::getProcessComponentContext());
mxCanvas = Reference<rendering::XCanvas>(
context->getServiceManager()->createInstanceWithArgumentsAndContext(
"com.sun.star.rendering.Canvas.VCL", aArg, context),
UNO_QUERY);
}
return mxCanvas;
}
awt::Point SAL_CALL SidebarPanel::getPositionOnScreen (void)
throw (cssu::RuntimeException)
{
awt::Point aAwtPoint;
if (mpPanel != NULL)
{
::vos::OGuard aGuard (Application::GetSolarMutex());
// mpPanel->GetPosPixel()
const Point aLocationOnScreen (mpPanel->OutputToAbsoluteScreenPixel(Point(0,0)));
aAwtPoint.X = aLocationOnScreen.X();
aAwtPoint.Y = aLocationOnScreen.Y();
}
return aAwtPoint;
}
Reference<beans::XPropertySet> SAL_CALL SidebarPanel::getThemeProperties (void)
throw (RuntimeException)
{
return Theme::GetPropertySet();
}
IMPL_LINK(SidebarPanel, HandleWindowEvent, VclWindowEvent*, pEvent)
{
if (pEvent != NULL)
{
switch (pEvent->GetId())
{
case SFX_HINT_DYING:
dispose();
break;
default:
break;
}
}
return sal_True;
}
} } // end of namespace sfx2::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_SIDEBARPANEL_HXX
#define INCLUDED_SFX2_SOURCE_SIDEBAR_SIDEBARPANEL_HXX
#include <tools/link.hxx>
#include <com/sun/star/ui/XSidebarPanel.hpp>
#include <boost/noncopyable.hpp>
#include <cppuhelper/compbase1.hxx>
#include <cppuhelper/basemutex.hxx>
namespace cssu = ::com::sun::star::uno;
namespace
{
typedef ::cppu::WeakComponentImplHelper1 <
css::ui::XSidebarPanel
> SidebarPanelInterfaceBase;
}
class DockingWindow;
class VclWindowEvent;
namespace sfx2 { namespace sidebar {
class Panel;
class SidebarPanel
: private ::boost::noncopyable,
private ::cppu::BaseMutex,
public SidebarPanelInterfaceBase
{
public:
static cssu::Reference<css::ui::XSidebarPanel> Create (Panel* pPanel);
protected:
SidebarPanel(
Panel* pPanel);
virtual ~SidebarPanel (void);
virtual void SAL_CALL disposing (const css::lang::EventObject& rEventObject)
throw(cssu::RuntimeException);
virtual void SAL_CALL disposing (void) SAL_OVERRIDE;
private:
Panel* mpPanel;
cssu::Reference<css::rendering::XCanvas> mxCanvas;
DECL_LINK(HandleWindowEvent, VclWindowEvent*);
};
} } // end of namespace sfx2::sidebar
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -47,7 +47,6 @@
#include <vbahelper/vbahelper.hxx>
#include "vbarevisions.hxx"
#include "vbaframes.hxx"
#include "vbaformfields.hxx"
#include <osl/file.hxx>
#include <tools/urlobj.hxx>
......
/* -*- 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 "vbaformfield.hxx"
#include <vbahelper/vbahelper.hxx>
#include <tools/diagnose_ex.h>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextContent.hpp>
#include <com/sun/star/text/XTextViewCursor.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <ecmaflds.hxx>
#include "vbacheckbox.hxx"
using namespace ::ooo::vba;
using namespace ::com::sun::star;
SwVbaFormField::SwVbaFormField( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& rModel, const uno::Reference< text::XFormField >& xFormField ) throw ( uno::RuntimeException ) : SwVbaFormField_BASE( rParent, rContext ), mxModel( rModel ), mxFormField( xFormField )
{
}
SwVbaFormField::~SwVbaFormField()
{
}
OUString SAL_CALL SwVbaFormField::getResult() throw ( uno::RuntimeException )
{
OUString sResult;
OUString sType = mxFormField->getFieldType();
if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMTEXT ) )
{
uno::Reference< text::XTextContent > xTextContent( mxFormField, uno::UNO_QUERY_THROW );
uno::Reference< text::XTextRange > xTextRange = xTextContent->getAnchor();
sResult = xTextRange->getString();
}
else if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX ) )
{
sal_Int32 nValue = 0;
sal_Int32 nCount = mxFormField->getParamCount();
for( sal_Int32 i = 0; i < nCount; i++ )
{
if( mxFormField->getParamName(i).equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX_CHECKED ) )
{
if( mxFormField->getParamValue(i).equalsIgnoreAsciiCase("on") )
nValue = 1;
else
nValue = 0;
break;
}
}
sResult = OUString::valueOf( nValue );
}
else
{
throw uno::RuntimeException("Not implemented", uno::Reference< uno::XInterface >() );
}
return sResult;
}
void SAL_CALL SwVbaFormField::setResult( const OUString& result ) throw ( uno::RuntimeException )
{
OUString sType = mxFormField->getFieldType();
if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMTEXT ) )
{
uno::Reference< text::XTextContent > xTextContent( mxFormField, uno::UNO_QUERY_THROW );
uno::Reference< text::XTextRange > xTextRange = xTextContent->getAnchor();
xTextRange->setString( result );
}
else if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX ) )
{
// do nothing
}
else
{
throw uno::RuntimeException("Not implemented", uno::Reference< uno::XInterface >() );
}
}
sal_Bool SAL_CALL SwVbaFormField::getEnabled() throw ( uno::RuntimeException )
{
//always return true
return sal_True;
}
void SAL_CALL SwVbaFormField::setEnabled( sal_Bool/* enabled */ ) throw ( uno::RuntimeException )
{
// not support in Writer
}
uno::Any SAL_CALL SwVbaFormField::CheckBox() throw ( uno::RuntimeException )
{
return uno::makeAny( uno::Reference< word::XCheckBox >( new SwVbaCheckBox( this, mxContext, mxModel, mxFormField ) ) );
}
OUString
SwVbaFormField::getServiceImplName()
{
return OUString("SwVbaFormField");
}
uno::Sequence< OUString >
SwVbaFormField::getServiceNames()
{
static uno::Sequence< OUString > aServiceNames;
if ( aServiceNames.getLength() == 0 )
{
aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = "ooo.vba.word.FormField";
}
return aServiceNames;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_SW_SOURCE_UI_VBA_VBAFORMFIELD_HXX
#define INCLUDED_SW_SOURCE_UI_VBA_VBAFORMFIELD_HXX
#include <ooo/vba/word/XFormField.hpp>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/text/XFormField.hpp>
#include <vbahelper/vbahelperinterface.hxx>
typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XFormField > SwVbaFormField_BASE;
class SwVbaFormField : public SwVbaFormField_BASE
{
private:
css::uno::Reference< css::frame::XModel > mxModel;
css::uno::Reference< css::text::XFormField > mxFormField;
public:
SwVbaFormField( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const css::uno::Reference< css::text::XFormField >& xFormField ) throw ( css::uno::RuntimeException );
virtual ~SwVbaFormField();
// Methods
OUString SAL_CALL getResult() throw ( css::uno::RuntimeException );
void SAL_CALL setResult( const OUString& result ) throw ( css::uno::RuntimeException );
sal_Bool SAL_CALL getEnabled() throw ( css::uno::RuntimeException );
void SAL_CALL setEnabled( sal_Bool enabled ) throw ( css::uno::RuntimeException );
css::uno::Any SAL_CALL CheckBox() throw ( css::uno::RuntimeException );
// XHelperInterface
virtual OUString getServiceImplName();
virtual css::uno::Sequence<OUString> getServiceNames();
};
#endif // INCLUDED_SW_SOURCE_UI_VBA_VBAFORMFIELD_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "vbaformfields.hxx"
#include "vbaformfield.hxx"
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextViewCursor.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include "wordvbahelper.hxx"
#include <cppuhelper/implbase3.hxx>
using namespace ::ooo::vba;
using namespace ::com::sun::star;
typedef std::vector< uno::Reference< text::XFormField > > XFormFieldVec;
typedef ::cppu::WeakImplHelper1< container::XEnumeration > FormFiledEnumeration_BASE;
typedef ::cppu::WeakImplHelper3< container::XNameAccess, container::XIndexAccess, container::XEnumerationAccess > FormFieldCollectionHelper_BASE;
OUString lcl_getFormFieldName( const uno::Reference< text::XFormField >& xFormField )
{
OUString sName;
sal_Int32 nCount = xFormField->getParamCount();
for( sal_Int32 i = 0; i < nCount; i++ )
{
if( xFormField->getParamName(i).equalsIgnoreAsciiCase("Name") )
{
sName = xFormField->getParamValue(i);
OSL_TRACE("lcl_getFormFieldName: %s", OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() );
break;
}
}
return sName;
}
class FormFieldsEnumeration : public FormFiledEnumeration_BASE
{
private:
uno::Reference< XHelperInterface > mxParent;
uno::Reference< uno::XComponentContext > mxContext;
uno::Reference< frame::XModel > mxModel;
XFormFieldVec mxFormFields;
XFormFieldVec::iterator cachePos;
public:
FormFieldsEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const XFormFieldVec& xFormFiels ) throw (uno::RuntimeException) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel ), mxFormFields( xFormFiels ), cachePos( mxFormFields.begin() )
{
}
virtual sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException)
{
return ( cachePos != mxFormFields.end() );
}
virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
if ( !hasMoreElements() )
throw container::NoSuchElementException();
uno::Reference< text::XFormField > xFormField( *cachePos++ );
return uno::makeAny( uno::Reference< word::XFormField > ( new SwVbaFormField( mxParent, mxContext, mxModel, xFormField ) ) );
}
};
class FormFieldCollectionHelper : public FormFieldCollectionHelper_BASE
{
private:
uno::Reference< XHelperInterface > mxParent;
uno::Reference< uno::XComponentContext > mxContext;
uno::Reference< frame::XModel > mxModel;
XFormFieldVec mxFormFields;
XFormFieldVec::iterator cachePos;
public:
FormFieldCollectionHelper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel )
{
uno::Reference< text::XBookmarksSupplier > xBookmarksSupplier( xModel,uno::UNO_QUERY_THROW );
uno::Reference< container::XIndexAccess > xIndexAccess( xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY_THROW );
sal_Int32 nCount = xIndexAccess->getCount();
for( sal_Int32 i = 0; i < nCount; i++ )
{
uno::Reference< text::XFormField > xFormField( xIndexAccess->getByIndex( i ), uno::UNO_QUERY );
if( xFormField.is() )
mxFormFields.push_back( xFormField );
}
cachePos = mxFormFields.begin();
}
// XElementAccess
virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return cppu::UnoType<word::XFormField>::get(); }
virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return getCount() > 0 ; }
// XNameAcess
virtual uno::Any SAL_CALL getByName( const OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
if ( !hasByName(aName) )
throw container::NoSuchElementException();
uno::Reference< text::XFormField > xFormField( *cachePos, uno::UNO_QUERY_THROW );
return uno::makeAny( uno::Reference< word::XFormField >( new SwVbaFormField( mxParent, mxContext, mxModel, xFormField ) ) );
}
virtual uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException)
{
uno::Sequence< OUString > sNames( mxFormFields.size() );
OUString* pString = sNames.getArray();
XFormFieldVec::iterator it = mxFormFields.begin();
XFormFieldVec::iterator it_end = mxFormFields.end();
for ( ; it != it_end; ++it, ++pString )
{
uno::Reference< text::XFormField > xFormField( *cachePos, uno::UNO_QUERY_THROW );
*pString = lcl_getFormFieldName( xFormField );
}
return sNames;
}
virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (uno::RuntimeException)
{
cachePos = mxFormFields.begin();
XFormFieldVec::iterator it_end = mxFormFields.end();
for ( ; cachePos != it_end; ++cachePos )
{
//uno::Reference< container::XNamed > xName( *cachePos, uno::UNO_QUERY_THROW );
uno::Reference< text::XFormField > xFormField( *cachePos, uno::UNO_QUERY_THROW );
if ( aName.equalsIgnoreAsciiCase( lcl_getFormFieldName( xFormField )) )
break;
}
return ( cachePos != it_end );
}
// XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
{
return mxFormFields.size();
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
if ( Index < 0 || Index >= getCount() )
throw lang::IndexOutOfBoundsException();
return uno::makeAny( uno::Reference< word::XFormField >( new SwVbaFormField( mxParent, mxContext, mxModel, mxFormFields[ Index ] ) ) );
}
// XEnumerationAccess
virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException)
{
return new FormFieldsEnumeration( mxParent, mxContext, mxModel, mxFormFields );
}
};
SwVbaFormFields::SwVbaFormFields( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ): SwVbaFormFields_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new FormFieldCollectionHelper( xParent, xContext, xModel ) ) ), mxModel( xModel )
{
}
// XEnumerationAccess
uno::Type
SwVbaFormFields::getElementType() throw (uno::RuntimeException)
{
return cppu::UnoType<word::XFormField>::get();
}
uno::Reference< container::XEnumeration >
SwVbaFormFields::createEnumeration() throw (uno::RuntimeException)
{
uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xIndexAccess, uno::UNO_QUERY_THROW );
return xEnumAccess->createEnumeration();
}
uno::Any
SwVbaFormFields::createCollectionObject( const css::uno::Any& aSource )
{
return aSource;
}
OUString
SwVbaFormFields::getServiceImplName()
{
return OUString("SwVbaFormFields");
}
css::uno::Sequence<OUString>
SwVbaFormFields::getServiceNames()
{
static uno::Sequence< OUString > sNames;
if ( sNames.getLength() == 0 )
{
sNames.realloc( 1 );
sNames[0] = "ooo.vba.word.FormFields";
}
return sNames;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_SW_SOURCE_UI_VBA_VBAFORMFIELDS_HXX
#define INCLUDED_SW_SOURCE_UI_VBA_VBAFORMFIELDS_HXX
#include <vbahelper/vbacollectionimpl.hxx>
#include <ooo/vba/word/XFormFields.hpp>
#include <vbahelper/vbahelperinterface.hxx>
#include <com/sun/star/text/XBookmarksSupplier.hpp>
#include <com/sun/star/text/XTextRange.hpp>
typedef CollTestImplHelper< ooo::vba::word::XFormFields > SwVbaFormFields_BASE;
class SwVbaFormFields : public SwVbaFormFields_BASE
{
private:
css::uno::Reference< css::frame::XModel > mxModel;
public:
SwVbaFormFields( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel );
virtual ~SwVbaFormFields() {}
// XEnumerationAccess
virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) SAL_OVERRIDE;
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) SAL_OVERRIDE;
// SwVbaFormFields_BASE
virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) SAL_OVERRIDE;
virtual OUString getServiceImplName() SAL_OVERRIDE;
virtual css::uno::Sequence<OUString> getServiceNames() SAL_OVERRIDE;
};
#endif // INCLUDED_SW_SOURCE_UI_VBA_VBAFORMFIELDS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment