Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style name does not match the name in styles.xml #2377

Closed
qwertynik opened this issue Feb 8, 2023 · 1 comment
Closed

Style name does not match the name in styles.xml #2377

qwertynik opened this issue Feb 8, 2023 · 1 comment

Comments

@qwertynik
Copy link

qwertynik commented Feb 8, 2023

Describe the Bug

The styles.xml contains a style with the TableParagraph. When accessing this using Style::getStyle(..) style object should be returned, but null is returned.

Steps to Reproduce

test.docx

<?php
use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\Style;

require __DIR__ . '/vendor/autoload.php';

$documentPath = 'test.docx';
$phpWord = IOFactory::load($documentPath);

var_dump(Style::getStyle('TableParagraph')); //prints NULL

var_dump(Style::getStyle('Table Paragraph')); //prints style object

Expected Behavior

The styles.xml contains a style with the TableParagraph. When accessing this using Style::getStyle(..) style object should be returned.

Current Behavior

null is returned.

Context

  • PHP Version: 7.4.6
  • PHPWord Version: 1.0
@qwertynik
Copy link
Author

Noticed that there's another tag w:name storing the name.

image

Does not look like an issue. Closing this. Can be reopened in case any of the maintainers see this as an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant