Skip to content

Commit

Permalink
Implemented default methods for the IWordWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
speckyspooky committed Nov 13, 2024
1 parent 834b57a commit 4240f37
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/*******************************************************************************
* Copyright (c) 2013 Actuate Corporation.
*
* Copyright (c) 2013, 2024 Actuate Corporation and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/.
*
*
* SPDX-License-Identifier: EPL-2.0
*
*
* Contributors:
* Actuate Corporation - initial API and implementation
* Actuate Corporation - initial API and implementation
* Thomas Gutmann - add option to handle footer wrapper
*******************************************************************************/

package org.eclipse.birt.report.engine.emitter.docx.writer;
Expand All @@ -25,6 +26,16 @@ public class Footer extends BasicComponent {
int footerWidth;
boolean wrapFooter;

/**
* Constructor 1
*/
Footer(IPart part, Document document, int footerHeight, int footerWidth) throws IOException {
this(part, document, footerHeight, footerWidth, true);
}

/**
* Constructor 2
*/
Footer(IPart part, Document document, int footerHeight, int footerWidth, boolean wrapFooter) throws IOException {
super(part);
this.document = document;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/*******************************************************************************
* Copyright (c) 2013 Actuate Corporation.
*
* Copyright (c) 2013, 2024 Actuate Corporation.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/.
*
*
* SPDX-License-Identifier: EPL-2.0
*
*
* Contributors:
* Actuate Corporation - initial API and implementation
* Actuate Corporation - initial API and implementation
* Thomas Gutmann - add option to handle header wrapper
*******************************************************************************/

package org.eclipse.birt.report.engine.emitter.docx.writer;
Expand All @@ -34,6 +35,16 @@ public class Header extends BasicComponent {
int headerWidth;
boolean wrapHeader;

/**
* Constructor 1
*/
Header(IPart part, Document document, int headerHeight, int headerWidth) throws IOException {
this(part, document, headerHeight, headerWidth, true);
}

/**
* Constructor 2
*/
Header(IPart part, Document document, int headerHeight, int headerWidth, boolean wrapHeader) throws IOException {
super(part);
this.document = document;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,16 +380,20 @@ void writeContent(int type, String txt, IStyle style, IStyle inlineStyle, String

/**
* Set the layout attribute for header and footer wrapping
*
* @param useWrappedTable use layout grid to wrap header and footer
*
* @param useWrappedTable use layout grid to wrap header and footer
*/
void setWrappedTableHeaderFooter(boolean useWrappedTable);
default void setWrappedTableHeaderFooter(boolean useWrappedTable) {
// do nothing
}

/**
* Get the configuration of layout-grid usage for header and footer
*
* @return the configuration of layout-grid usage for header and footer
*
* @return the configuration of layout-grid usage for header and footer
*/
boolean getWrappedTableHeaderFooter();
default boolean getWrappedTableHeaderFooter() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -606,14 +606,4 @@ public void setDocumentLanguage(String language) {
public String getDocumentLanguage() {
return this.documentLanguage;
}

@Override
public void setWrappedTableHeaderFooter(boolean useWrappedTable) {
this.wrappedTableHeaderFooter = useWrappedTable;
}

@Override
public boolean getWrappedTableHeaderFooter() {
return this.wrappedTableHeaderFooter;
}
}

0 comments on commit 4240f37

Please sign in to comment.